Switch back to custom mastodon.nix queue definitions
This commit is contained in:
parent
391c3bf46f
commit
bab7179c36
@ -5,7 +5,7 @@
|
||||
systemd.services."mastodon-init-dirs".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."mastodon-media-auto-remove".startAt = lib.mkForce [ ];
|
||||
systemd.services."mastodon-media-auto-remove".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."mastodon-sidekiq-all".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."mastodon-sidekiq".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."mastodon-streaming".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."mastodon-web".wantedBy = lib.mkForce [ ];
|
||||
systemd.services."postgresqlBackup-mastodon".startAt = lib.mkForce [ ];
|
||||
|
28
mastodon.nix
28
mastodon.nix
@ -34,6 +34,29 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
sidekiq-manager = pkgs.writers.writePython3 "sidekiq-manager" {} ''
|
||||
from itertools import permutations
|
||||
from subprocess import Popen
|
||||
|
||||
|
||||
def sidekiq(queues, connections=16):
|
||||
mastodon = "${mastodon-lor-sh}"
|
||||
cmd = [f"{mastodon}/bin/sidekiq", "-r", mastodon]
|
||||
cmd += ["-c", f"{connections}"]
|
||||
for q in queues:
|
||||
cmd += ['-q', q]
|
||||
return Popen(cmd)
|
||||
|
||||
|
||||
procs = [sidekiq(['mailers', 'pull'])]
|
||||
|
||||
queues = ['default', 'push', 'ingress']
|
||||
procs += [sidekiq(qs) for qs in permutations(queues)]
|
||||
|
||||
p = sidekiq([])
|
||||
p.wait()
|
||||
'';
|
||||
|
||||
s3cmd = pkgs.writeShellScript "s3cmd" ''
|
||||
${pkgs.s3cmd}/bin/s3cmd \
|
||||
--access_key='${secrets.backup.accessKey}' \
|
||||
@ -91,6 +114,9 @@ in {
|
||||
rm mastodon.sql.gz.gpg
|
||||
'';
|
||||
|
||||
systemd.services.mastodon-sidekiq-all.serviceConfig.ExecStart =
|
||||
lib.mkForce "${sidekiq-manager}";
|
||||
|
||||
# https://github.com/mperham/sidekiq/wiki/Memory#bloat
|
||||
systemd.services.mastodon-sidekiq-all.environment.MALLOC_ARENA_MAX = "2";
|
||||
|
||||
@ -168,7 +194,5 @@ in {
|
||||
DEEPL_API_KEY = secrets.DEEPL_API_KEY;
|
||||
DEEPL_PLAN = "pro";
|
||||
};
|
||||
|
||||
sidekiqThreads = 128;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user