Commit 957d938
feat: cap cluster worker count via IFRAMELY_WORKERS_COUNT (#4)
graceful-cluster defaults to os.cpus().length workers, which is the HOST
node's vCPU count and ignores the container's CPU limit. On large nodes
(e.g. 32 vCPU) this forks ~32 workers, each independently loading ~1886
domains + Redis + Secrets Manager, exhausting the pod memory limit ->
OOMKilled/CrashLoopBackOff.
Pass workersCount to GracefulCluster.start from CONFIG.CLUSTER_WORKERS_COUNT,
settable via IFRAMELY_WORKERS_COUNT (alias IFRAMELY_WORKERS). When unset,
behaviour is unchanged (falls back to os.cpus().length).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a70dac1 commit 957d938
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
0 commit comments