nixos/mastodon: Add configurable web- and streaming concurrency
Might as well do this while I'm at it. (cherry picked from commit 0d719125baee88e2e8d29e6bb2ff3100ba1b2da0)
This commit is contained in:
parent
4f8927c417
commit
04c2339cc1
@ -9,6 +9,13 @@ let
|
|||||||
RAILS_ENV = "production";
|
RAILS_ENV = "production";
|
||||||
NODE_ENV = "production";
|
NODE_ENV = "production";
|
||||||
|
|
||||||
|
# mastodon-web concurrency.
|
||||||
|
WEB_CONCURRENCY = toString cfg.webProcesses;
|
||||||
|
MAX_THREADS = toString cfg.webThreads;
|
||||||
|
|
||||||
|
# mastodon-streaming concurrency.
|
||||||
|
STREAMING_CLUSTER_NUM = toString cfg.streamingProcesses;
|
||||||
|
|
||||||
DB_USER = cfg.database.user;
|
DB_USER = cfg.database.user;
|
||||||
|
|
||||||
REDIS_HOST = cfg.redis.host;
|
REDIS_HOST = cfg.redis.host;
|
||||||
@ -146,12 +153,30 @@ in {
|
|||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
default = 55000;
|
default = 55000;
|
||||||
};
|
};
|
||||||
|
streamingProcesses = lib.mkOption {
|
||||||
|
description = ''
|
||||||
|
Processes used by the mastodon-streaming service.
|
||||||
|
Defaults to the number of CPU cores minus one.
|
||||||
|
'';
|
||||||
|
type = lib.types.nullOr lib.types.int;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
webPort = lib.mkOption {
|
webPort = lib.mkOption {
|
||||||
description = "TCP port used by the mastodon-web service.";
|
description = "TCP port used by the mastodon-web service.";
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
default = 55001;
|
default = 55001;
|
||||||
};
|
};
|
||||||
|
webProcesses = lib.mkOption {
|
||||||
|
description = "Processes used by the mastodon-web service.";
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2;
|
||||||
|
};
|
||||||
|
webThreads = lib.mkOption {
|
||||||
|
description = "Threads per process used by the mastodon-web service.";
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 5;
|
||||||
|
};
|
||||||
|
|
||||||
sidekiqPort = lib.mkOption {
|
sidekiqPort = lib.mkOption {
|
||||||
description = "TCP port used by the mastodon-sidekiq service.";
|
description = "TCP port used by the mastodon-sidekiq service.";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user