diff --git a/scripts/detect-memory.sh b/scripts/detect-memory.sh index d6c5529..9423917 100755 --- a/scripts/detect-memory.sh +++ b/scripts/detect-memory.sh @@ -69,7 +69,15 @@ esac # --- PHP-FPM parameters (skipped for httpd_only) --- if [ "$CONTAINER_ROLE" != "httpd_only" ]; then - PHP_WORKER_ESTIMATE_MB=${PHP_WORKER_ESTIMATE_MB:-60} + # PHP_WORKER_ESTIMATE_MB sizes the divisor for pm.max_children. The + # previous default of 60 was optimistic for modern Woo/Elementor stacks: + # the alphaone 2026-06-01 incident measured ~193 MB resident per worker + # against the 60 MB assumption, and 15 calculated children put peak + # demand (15 * 193 = 2.9 GB) over the 1-2 GiB container cap. 128 lands + # closer to plugin-heavy WP reality while remaining conservative for + # leaner sites. Customers can still override via the FPM_MAX_CHILDREN + # env var on the container if a different shape is justified. + PHP_WORKER_ESTIMATE_MB=${PHP_WORKER_ESTIMATE_MB:-128} calc_max_children=$((PHP_BUDGET_MB / PHP_WORKER_ESTIMATE_MB)) # Floor at 2, cap at 50