mirror of
https://github.com/dali99/nixos-matrix-modules.git
synced 2026-03-29 03:44:01 +02:00
Add withJemalloc setting, enable by default
This commit is contained in:
@@ -70,6 +70,14 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
withJemalloc = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to preload jemalloc to reduce memory fragmentation and overall usage.
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/matrix-synapse";
|
||||
@@ -425,6 +433,11 @@ in
|
||||
partOf = [ "matrix-synapse.target" ];
|
||||
wantedBy = [ "matrix-synapse.target" ];
|
||||
|
||||
environment = lib.optionalAttrs cfg.withJemalloc {
|
||||
LD_PRELOAD = "${pkgs.jemalloc}/lib/libjemalloc.so";
|
||||
PYTHONMALLOC = "malloc";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
User = "matrix-synapse";
|
||||
|
||||
@@ -374,6 +374,12 @@ in {
|
||||
wantedBy = [ "matrix-synapse.target" ];
|
||||
after = [ "matrix-synapse.service" ];
|
||||
requires = [ "matrix-synapse.service" ];
|
||||
|
||||
environment = lib.optionalAttrs cfg.withJemalloc {
|
||||
LD_PRELOAD = "${pkgs.jemalloc}/lib/libjemalloc.so";
|
||||
PYTHONMALLOC = "malloc";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
User = "matrix-synapse";
|
||||
|
||||
Reference in New Issue
Block a user