mirror of
https://github.com/dali99/nixos-matrix-modules.git
synced 2026-06-30 11:25:22 +02:00
synapse: 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 {
|
dataDir = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "/var/lib/matrix-synapse";
|
default = "/var/lib/matrix-synapse";
|
||||||
@@ -425,6 +433,11 @@ in
|
|||||||
partOf = [ "matrix-synapse.target" ];
|
partOf = [ "matrix-synapse.target" ];
|
||||||
wantedBy = [ "matrix-synapse.target" ];
|
wantedBy = [ "matrix-synapse.target" ];
|
||||||
|
|
||||||
|
environment = lib.optionalAttrs cfg.withJemalloc {
|
||||||
|
LD_PRELOAD = "${pkgs.jemalloc}/lib/libjemalloc.so";
|
||||||
|
PYTHONMALLOC = "malloc";
|
||||||
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "notify";
|
Type = "notify";
|
||||||
User = "matrix-synapse";
|
User = "matrix-synapse";
|
||||||
|
|||||||
@@ -374,6 +374,12 @@ in {
|
|||||||
wantedBy = [ "matrix-synapse.target" ];
|
wantedBy = [ "matrix-synapse.target" ];
|
||||||
after = [ "matrix-synapse.service" ];
|
after = [ "matrix-synapse.service" ];
|
||||||
requires = [ "matrix-synapse.service" ];
|
requires = [ "matrix-synapse.service" ];
|
||||||
|
|
||||||
|
environment = lib.optionalAttrs cfg.withJemalloc {
|
||||||
|
LD_PRELOAD = "${pkgs.jemalloc}/lib/libjemalloc.so";
|
||||||
|
PYTHONMALLOC = "malloc";
|
||||||
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "notify";
|
Type = "notify";
|
||||||
User = "matrix-synapse";
|
User = "matrix-synapse";
|
||||||
|
|||||||
Reference in New Issue
Block a user