From e6f67cc25941bef6496e9f24dba1a6ecab2f63ad Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 30 Dec 2024 17:29:02 +0100 Subject: [PATCH] nixos/matrix-synapse: configure PYTHONMALLOC when using jemalloc Per a synapse FAQ entry[1] this should be set in combination with\ jemalloc to make sure that jemalloc can accurately calculate memory usage. [1] https://github.com/element-hq/synapse/blob/develop/docs/usage/administration/admin_faq.md#help-synapse-is-slow-and-eats-all-my-ramcpu --- nixos/modules/services/matrix/synapse.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/matrix/synapse.nix b/nixos/modules/services/matrix/synapse.nix index 2b0eb43605d8..5ed02623953d 100644 --- a/nixos/modules/services/matrix/synapse.nix +++ b/nixos/modules/services/matrix/synapse.nix @@ -1462,6 +1462,7 @@ in baseServiceConfig = { environment = optionalAttrs (cfg.withJemalloc) { LD_PRELOAD = "${pkgs.jemalloc}/lib/libjemalloc.so"; + PYTHONMALLOC = "malloc"; }; serviceConfig = { Type = "notify";