Skip to content
Snippets Groups Projects
Unverified Commit c7446906 authored by realtyem's avatar realtyem Committed by GitHub
Browse files

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

parent c3e4edb4
No related branches found
No related tags found
No related merge requests found
Set LD_PRELOAD to use jemalloc memory allocator in Dockerfile-workers.
......@@ -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,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment