add termination cooldown for slot scale-down
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.

This commit is contained in:
Abel Luck 2026-02-27 18:37:58 +01:00
parent e1dbd5c119
commit 44bc99ab85
7 changed files with 72 additions and 1 deletions

View file

@ -205,6 +205,12 @@ in
description = "Max seconds between terminate retries while slot is terminating.";
};
terminationCooldownSeconds = lib.mkOption {
type = lib.types.int;
default = 180;
description = "Minimum cooldown in seconds between starting slot terminations.";
};
launchBatchSize = lib.mkOption {
type = lib.types.int;
default = 1;
@ -329,6 +335,7 @@ in
boot_timeout_seconds = ${toString cfg.capacity.bootTimeoutSeconds}
binding_timeout_seconds = ${toString cfg.capacity.bindingTimeoutSeconds}
terminating_timeout_seconds = ${toString cfg.capacity.terminatingTimeoutSeconds}
termination_cooldown_seconds = ${toString cfg.capacity.terminationCooldownSeconds}
[security]
socket_mode = "${cfg.security.socketMode}"
@ -343,6 +350,7 @@ in
max_leases_per_slot = ${toString cfg.capacity.maxLeasesPerSlot}
launch_batch_size = ${toString cfg.capacity.launchBatchSize}
scale_down_idle_seconds = ${toString cfg.capacity.idleScaleDownSeconds}
termination_cooldown_seconds = ${toString cfg.capacity.terminationCooldownSeconds}
EOF
chown ${cfg.user}:${cfg.group} ${generatedConfigPath}