From d7c0be958df516c70eb7955e1783da991c3d36fb Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 9 Feb 2019 13:55:24 +0000 Subject: [PATCH] Run python with jemalloc in containers jemalloc is apparently good with python memory according to https://zapier.com/engineering/celery-python-jemalloc/ Also, according to these graphs from Tobias: https://paste.pics/581cc286226407ab0be400b94951a7d9 it helps with the apparent memory leak seen in python3.6 and python3.7 with zuul. There doesn't seem to be any downside to it, so install it and enable it. Change-Id: I354bc35e5fa1aee90e1c8b6918c5a70dafd4f990 --- docker/python-base/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/python-base/Dockerfile b/docker/python-base/Dockerfile index e89c3ae3ee..9a975eebcc 100644 --- a/docker/python-base/Dockerfile +++ b/docker/python-base/Dockerfile @@ -16,7 +16,8 @@ FROM python:slim RUN apt-get update \ - && apt-get install -y dumb-init \ + && apt-get install -y dumb-init libjemalloc1 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so.1 ENTRYPOINT ["/usr/bin/dumb-init", "--"]