Bound warm workers' host memory and account local RAM

A worker over FLOW_WORKER_MAX_RSS_MB (--worker-max-rss) when its node
returns is retired instead of kept warm, in the shared pool and in every
declared one; 0, the default, keeps them all. The engine now accounts its
own memory (FLOW_RAM / --ram, else the box or the cgroup limit less 1 GB),
so a node's `ram` declaration holds locally. A declared environment the
shared pool already has is that pool rather than a duplicate set of warm
workers.
This commit is contained in:
2026-09-27 16:11:13 +02:00
parent 7240b7b823
commit 0649062327
10 changed files with 143 additions and 8 deletions
+10
View File
@@ -142,6 +142,16 @@ class Settings(BaseSettings):
# NVIDIA device nodes, the way 0 cores works the core count out; anything
# else — another vendor, or keeping a card back — is said outright.
FLOW_GPUS: int = 0
# Megabytes nodes that declare `ram` may be given. 0 works it out: the
# machine's memory, or the container's limit where that is lower, less a
# gigabyte for the engine. Like cores, a node declaring nothing is not
# counted against it.
FLOW_RAM: int = 0
# A warm worker is retired rather than kept when its node returns with the
# process holding more than this many megabytes resident. A library that
# grew it then gives the memory back, and the next call pays its imports
# again. 0, the default, keeps every worker warm.
FLOW_WORKER_MAX_RSS_MB: int = 0
# How long the engine's own metrics, events and run records are kept.
#: The largest body `PUT /artifacts` will take, in bytes. A checkpoint or a
#: video segment is a legitimate artifact, so this is generous rather than