Files
cloud-apache-container/scripts
shadowdaoandClaude Opus 5 5e83c8db3b fix(lsphp): set LSAPI_KEEP_LISTEN=2 to stop idle-exit timing from following the leaked busy counter
lsphp's master keeps a `busy` worker counter in a MAP_SHARED page that drifts
negative over days of uptime (measured live on whp01: busy=-8 after 6.9 days
on arclightcourt.com-01 vs 0..9 on a healthy sibling). php-src's
sapi/litespeed/lsapilib.c derives each child's idle-exit grace period from
that counter (10 + busy*10, capped by LSAPI_MAX_IDLE) only inside
`if (s_keep_listener == 1)`; with busy=-8 that's -70s, so workers exit after
~1s idle instead of 10-30s, no worker ever lingers in accept(), the
"don't fork, one's already listening" guard never fires, and the master
forks for every connection -- confirmed hitting the max-children ceiling and
producing 503s under bot traffic (306 OLS-side ExtConn-timeout/503 errors on
the affected site vs 0 on an identical healthy sibling).

LSAPI_KEEP_LISTEN=2 skips the `== 1` branch entirely so idle-exit timing
falls back to LSAPI_MAX_IDLE (already 30 by default here) instead of the
leaked counter. is_enough_free_mem() sits above that branch, not inside it,
so the memory-pressure guard is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 14:47:08 -07:00
..
2026-02-08 07:57:04 -08:00