PHP-FPM pm.max_children Calculator
Size a PHP-FPM pool from server memory and per-process memory: pm.max_children, start and spare servers, for dynamic, static or ondemand.
Free · No sign-up · Your inputs stay in your browser
Input
Size a PHP-FPM pool
Output
Pool settings (www.conf)
3072 MB for PHP / 60 MB per process
Note
51 workers on 2 cores
Fine for I/O-bound apps waiting on a database or API. For CPU-bound work, extra workers only queue for the CPU; a lower max_children gives faster responses.
max_children is memory for PHP divided by the size of one worker, so that a full pool never pushes the box into swap. The spare-server figures are 25% and 75% of it. static suits a server that does nothing else; ondemand suits small, mostly idle pools. pm.max_requests recycles workers to contain slow memory leaks.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
The constraint is memory
Each PHP-FPM worker holds its own copy of the request's memory, so pm.max_children times the average worker size must fit in the memory left after the OS, the web server and any database on the same machine. Exceed it and the box swaps, every request slows down and the pool falls further behind. Measure the size under real traffic: ps -ylC php-fpm8.4 --sort:rss lists each worker's resident memory.
Choosing a process manager
static keeps max_children running, which suits a dedicated server. dynamic keeps between the spare limits idle and grows to the maximum. ondemand starts workers only when requests arrive, which saves memory on small or mostly idle pools. The directives are documented in the PHP-FPM configuration reference.