Add threads & workers options

This commit is contained in:
niten 2024-05-24 15:55:54 -07:00
parent c2370eddb1
commit e64fa22de6
1 changed files with 17 additions and 1 deletions

View File

@ -29,6 +29,18 @@ in {
description = "Path on which to store service state."; description = "Path on which to store service state.";
}; };
workers = mkOption {
type = int;
description = "Number of workers to run.";
default = 3;
};
threads = mkOption {
type = int;
description = "Number of request threads to run.";
default = 12;
};
immich-version = mkOption { type = str; }; immich-version = mkOption { type = str; };
debug = mkEnableOption "Enable debugging logs."; debug = mkEnableOption "Enable debugging logs.";
@ -48,7 +60,11 @@ in {
ports = ports =
[ "${toString cfg.port}:3003" "${toString cfg.metrics-port}:9090" ]; [ "${toString cfg.port}:3003" "${toString cfg.metrics-port}:9090" ];
extraOptions = [ "--gpus=all" ]; extraOptions = [ "--gpus=all" ];
environment.IMMICH_METRICS = "true"; environment = {
IMMICH_METRICS = "true";
MACHINE_LEARNING_WORKERS = cfg.workers;
MACHINE_LEARNING_REQUEST_THREADS = cfg.threads;
};
}; };
}; };