mirror of
https://github.com/penpot/penpot.git
synced 2026-11-18 16:12:24 +00:00
worker_processes auto starts one worker per host CPU, ignoring the container CPU limit, and since worker_connections went from 2048 to 65535 each worker reserves about 30 MB at startup. A frontend limited to a few CPUs on a 64-core node needs close to 2 GB before serving a request and gets OOM killed. Default the worker count to the CPUs the container can use, its cpuset and its cgroup CPU quota rounded up, when they are fewer than the CPUs of the host, and keep auto otherwise. Make both settings configurable through PENPOT_HTTP_SERVER_WORKER_PROCESSES and PENPOT_HTTP_SERVER_WORKER_CONNECTIONS, and refuse to start on values that are not valid. Refs #13103 Signed-off-by: David Barragán Merino <david.barragan@kaleidos.net>