How PHP-FPM's Dynamic Process Manager Actually Works, Explained with Real Data
PHP-FPM's dynamic process manager runs a single check roughly every second, forking a worker if idle processes fall below min_spare_servers and killing one if they exceed max_spare_servers. The pool never automatically shrinks back to start_servers after traffic subsides — it ratchets up easily but trims slowly, shedding only one worker per second once load drops. Under a 100-user load test, the pool grew from 50 to 72 workers on demand and gradually returned to 50 after traffic stopped, staying well within the max_children ceiling of 300. Memory sizing is critical: workers on a Laravel app consumed an average of 36.6 MB each when measured warm and under load, far more than the ~14 MB seen at a cold start. The recommended sizing formula — max_children equals available PHP RAM multiplied by 0.9, divided by average warm process size — helps prevent over-provisioning and out-of-memory crashes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in