浏览代码

Set LD_PRELOAD to load jemalloc in Dockerfile-workers. (#14182)

tags/v1.70.0rc1
realtyem 1年前
committed by GitHub
父节点
当前提交
c7446906bd
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 2 个文件被更改,包括 12 次插入1 次删除
  1. +1
    -0
      changelog.d/14182.docker
  2. +11
    -1
      docker/configure_workers_and_start.py

+ 1
- 0
changelog.d/14182.docker 查看文件

@@ -0,0 +1 @@
Set LD_PRELOAD to use jemalloc memory allocator in Dockerfile-workers.

+ 11
- 1
docker/configure_workers_and_start.py 查看文件

@@ -39,6 +39,7 @@
# continue to work if so.

import os
import platform
import subprocess
import sys
from pathlib import Path
@@ -632,14 +633,23 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
with open(mark_filepath, "w") as f:
f.write("")

# Lifted right out of start.py
jemallocpath = "/usr/lib/%s-linux-gnu/libjemalloc.so.2" % (platform.machine(),)

if os.path.isfile(jemallocpath):
environ["LD_PRELOAD"] = jemallocpath
else:
log("Could not find %s, will not use" % (jemallocpath,))

# Start supervisord, which will start Synapse, all of the configured worker
# processes, redis, nginx etc. according to the config we created above.
log("Starting supervisord")
os.execl(
os.execle(
"/usr/local/bin/supervisord",
"supervisord",
"-c",
"/etc/supervisor/supervisord.conf",
environ,
)




正在加载...
取消
保存