tune(litespeed): bump LSPHP_WORKER_ESTIMATE_MB 115 → 130
All checks were successful
Cloud Apache Container / Build-and-Push (74) (push) Successful in 2m33s
Cloud Apache Container / Build-and-Push (80) (push) Successful in 2m24s
Cloud Apache Container / Build-and-Push (81) (push) Successful in 2m8s
Cloud Apache Container / Build-and-Push (82) (push) Successful in 1m23s
Cloud Apache Container / Build-and-Push (83) (push) Successful in 2m21s
Cloud Apache Container / Build-and-Push (84) (push) Successful in 2m23s
Cloud Apache Container / Build-and-Push (85) (push) Successful in 2m21s
Cloud Apache Container / Build-FPM-Images (74) (push) Successful in 1m17s
Cloud Apache Container / Build-FPM-Images (80) (push) Successful in 1m14s
Cloud Apache Container / Build-FPM-Images (81) (push) Successful in 3m26s
Cloud Apache Container / Build-FPM-Images (82) (push) Successful in 2m16s
Cloud Apache Container / Build-FPM-Images (83) (push) Successful in 2m22s
Cloud Apache Container / Build-FPM-Images (84) (push) Successful in 2m1s
Cloud Apache Container / Build-FPM-Images (85) (push) Successful in 2m28s
Cloud Apache Container / Build-LiteSpeed-Images (81) (push) Successful in 1m30s
Cloud Apache Container / Build-LiteSpeed-Images (82) (push) Successful in 39s
Cloud Apache Container / Build-LiteSpeed-Images (83) (push) Successful in 1m12s
Cloud Apache Container / Build-LiteSpeed-Images (84) (push) Successful in 30s
Cloud Apache Container / Build-LiteSpeed-Images (85) (push) Successful in 30s
Cloud Apache Container / Build-Shared-httpd (push) Successful in 1m30s

115 was set from idle-state per-worker memory. Active workers on
heavy WP/Divi grow to ~130-150 MB (shmem + anon + file), and the
115 formula gave brain-jar.com CHILDREN=8 at 1 GiB — which produced
142 OOM-kills overnight because there was zero headroom once page
renders started.

130 backs off slightly on the bigger sites:
  512 MiB:  3 workers  (unchanged)
  1 GiB:    7 workers  (was 8 — brain-jar's failure point)
  1.5 GiB:  11 workers (was 12)
  2 GiB:    15 workers (was 17)
  4 GiB:    30 workers (was 33)

Per-site FPM_MAX_CHILDREN override still wins for sites that need
tighter caps regardless of formula default.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 18:54:28 -07:00
parent 03cca745f7
commit f463519998

View File

@@ -49,14 +49,22 @@ fi
## ---- LSAPI children (analogous to PHP_FPM_MAX_CHILDREN) ---- ## ---- LSAPI children (analogous to PHP_FPM_MAX_CHILDREN) ----
## Per the 2026-06-02 cac-litespeed memory-sizing finding (vantagehealth ## Per the 2026-06-02 cac-litespeed memory-sizing finding (vantagehealth
## OOM-spawn loop at 512 MB cap): each lsphp worker carries ~115 MB ## OOM-spawn loop at 512 MB cap): each lsphp worker carries ~115 MB
## shmem-rss which is RSS-accounted per worker (vs cac-fpm's COW-shared ## shmem-rss + ~25 MB anon + ~10 MB file ≈ 130-150 MB real cgroup cost
## fork model). Real-world worker budget ≈ 115 MB shmem + ~50-100 MB anon ## per worker on heavy WP workloads. shmem is RSS-accounted per worker
## that scales with workload. 115 MB is the safe per-worker estimate for ## (vs cac-fpm's COW-shared fork model) so the cost is real per cgroup,
## the divisor; floor at 2, cap at 50. ## not just per process.
## ##
## Sub-512 MB containers are unsafe for dynamic WP on OLS per the memory ## 115 (the previous default) was set from idle-state measurements and
## note — the floor of 2 workers still applies but it'll be cap-marginal. ## ran brain-jar.com into 142 OOM-kills at 1 GiB on 2026-06-02 night —
LSPHP_WORKER_ESTIMATE_MB=${LSPHP_WORKER_ESTIMATE_MB:-115} ## the formula computed CHILDREN=8, which left zero headroom once Divi
## page renders started growing worker anon. Bumped to 130 to track the
## active per-worker cost; gives slightly fewer workers but real headroom.
##
## Sub-512 MB containers remain unsafe for dynamic WP on OLS — the floor
## of 2 workers still applies but it'll be cap-marginal. Per-site override
## via FPM_MAX_CHILDREN env var (panel edit-site UI) overrides this for
## sites where the default isn't right for their workload.
LSPHP_WORKER_ESTIMATE_MB=${LSPHP_WORKER_ESTIMATE_MB:-130}
calc_lsapi_children=$((AVAILABLE_MB / LSPHP_WORKER_ESTIMATE_MB)) calc_lsapi_children=$((AVAILABLE_MB / LSPHP_WORKER_ESTIMATE_MB))
if [ "$calc_lsapi_children" -lt 2 ]; then if [ "$calc_lsapi_children" -lt 2 ]; then