TL;DR / Summary: On a dedicated host, PHP-FPM worker counts are a memory and latency trade, not a “set it to 50 and pray” ritual. Measure average process size, leave RAM for MySQL and the OS, and raise workers only until queue time drops without swapping.
Why dedicated boxes tempt bad FPM defaults
Cloud PaaS hides worker math. On dedicated metal you see sixteen cores and sixty-four gigabytes and assume more PHP children must be better. Then the database starves, the disk thrashes into swap, and response times get worse while top shows plenty of idle CPU.
PHP-FPM workers are concurrent request slots. Each slot costs resident memory. Too few and visitors wait in a queue. Too many and every slot is slightly slower because the machine is fighting itself.
Start from memory, not from core count. Cores matter after you know you will not swap.
Measure before you edit the pool file
Under realistic load, sample the average RSS of php-fpm workers. Multiply by a candidate pm.max_children and compare to RAM left after MySQL’s buffer pool, Redis if present, and a few gigabytes for the OS file cache.
- Average worker RSS — take it during a normal traffic hour, not during a deploy
- MySQL innodb_buffer_pool_size — already decided or renegotiated with this change
- Headroom — leave space so a traffic spike does not instantly hit swap
- Slow log enabled — you need to know if workers are busy with slow PHP, not just scarce
Hardware context helps. A machine chosen from best dedicated web hosting server options with plenty of RAM still loses if FPM and MySQL are both told they may eat the entire chassis.
pm modes that match traffic shape
Dynamic mode grows and shrinks children. Onboarding sites with spiky editorial traffic often like it. Static mode keeps a fixed army ready; it fits steady high traffic where spawn latency shows up in percentiles. Ondemand saves memory on quiet hosts but can stutter when a burst arrives.
A practical first pass
For a WordPress-heavy dedicated host with 32 GB RAM and a generous buffer pool, many teams land between 20 and 40 children—not 100—once RSS is measured. Your numbers will differ; the method should not.
If increasing max_children makes load average rise while time-to-first-byte stays flat, you bought concurrency you cannot feed.
Watch the queue, not only the CPU
FPM status pages and carefully sampled metrics show active processes versus the listen queue. A queue that stays above zero during peaks means you are short on children or each request is too slow. Fixing a slow plugin often frees more capacity than adding ten workers.
CPU steal is irrelevant on dedicated metal, but thermal limits and noisy neighbors are replaced by your own cron pile. Schedule heavy wp-cron or import jobs for off-peak so they do not occupy workers visitors need.
Request lifetime limits that protect the pool
request_terminate_timeout stops runaway scripts from owning a child forever. Pair it with application logging so you can find the offender. Without a timeout, one stuck payment callback can reduce your effective concurrency by one until someone restarts the pool.
Also rotate children with pm.max_requests if you fight gradual memory leaks in extensions. Rotation is a bandage; finding the leak is still the cure.
Change management that does not surprise shoppers
Change one variable at a time during a monitored window. Capture p95 latency and error rate before and after. Keep the previous pool config in version control so a bad guess rolls back in minutes.
Coordinate with anyone who tunes MySQL the same week. Two teams raising their appetites on the same dedicated server is a classic outage story.
Multiple pools on one dedicated host
Agencies often park several sites on one machine. Separate FPM pools per site with their own max_children caps so a noisy neighbor cannot adopt every worker. Give the busiest shop a higher ceiling and the brochure sites a modest one. Shared pools feel simpler until one viral post starves checkout on another vhost.
Name pools after sites, not after moods. Future you grepping configs at midnight deserves clarity.
Sum the children across pools when you do the RAM math. People size each pool correctly in isolation and still oversubscribe the chassis in aggregate.
Opcache and workers as a coupled system
A cold opcache during a reload makes every worker temporarily heavier and slower. Stagger reloads, warm caches with a small synthetic hit list, and avoid reloading FPM in the same minute you flush all caches “for luck.” The luck is usually bad.
After PHP upgrades, remeasure RSS. New extensions and opcache defaults change the memory story enough to invalidate last quarter’s max_children.
Socket backlog and httpd as silent partners
FPM children only help if the web server can hand them work. If the listen backlog or proxy timeouts are mis-tuned, you will see queued requests even with free workers. When latency rises after a children increase, check proxy error logs for upstream busy messages before blaming PHP again.
Keep HTTP keep-alive and FPM pm settings documented together so one ticket does not “fix” the wrong layer.
A sizing loop you can reuse quarterly
Re-check average RSS after major plugin or PHP version upgrades—they change memory footprints. Revisit max_children when you add a significant traffic channel or a new site on the same host. Dedicated hardware invites set-and-forget thinking; FPM pools prefer a light seasonal checkup instead of a midnight emergency edit during a sale.
