PHP-FPM pool configuration is what separates a VPS that handles 500 concurrent users from one that falls over at 50.
PHP-FPM manages a pool of PHP worker processes. When a request comes in, a worker handles it, then returns to the pool. The configuration determines how this pool behaves under load.
Critical settings:
`pm = dynamic` — allows the pool to grow and shrink based on demand. Static pools waste RAM during low traffic; ondemand pools have cold-start latency.
`pm.max_children` — the maximum number of PHP workers. Calculated as: (available RAM − OS overhead) / average PHP process memory. For WordPress: typically 20-80MB per process. On a 4GB server with 1GB reserved for MySQL and OS, you have ~3GB for PHP = 37-150 children.
`pm.max_requests = 500` — workers restart after handling 500 requests. Prevents memory leaks from accumulating indefinitely.
`request_terminate_timeout` — kills runaway PHP processes. Set to 60-90 seconds for most sites.
Diagnose pool saturation by checking `php-fpm.log` for "server reached pm.max_children" messages. If you see this, you need more workers, more RAM, or faster PHP execution.
Root Access Daily
@RootAccessDaily
PHP-FPM pool configuration is what separates a VPS that handles 500 concurrent users from one that falls over
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.