Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Calculate and Optimize PHP-FPM pm.max_children for High-Traffic WordPress on VPS

Marcus Sterling
Marcus SterlingWordPress Core Specialist
October 23, 2026
•
15 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Calculate and Optimize PHP-FPM pm.max_children for High-Traffic WordPress on VPS

Hostinger vs. Contabo: Full Specifications Breakdown

Data verified from our lab benchmarks • Updated for 2026

Feature / Metric
HostingerEditor's Choice UI
ContaboMax RAM Value
Starting Price$2.99 / month (Web) | $4.99 / mo (VPS)$5.50 / month (Cloud VPS S)
vCPU Cores1 to 8 vCPU (Dedicated resources)4 to 12 vCPU (High Core Count)
RAM Memory4 GB to 32 GB6 GB to 64 GB (Gigantic RAM)
Storage Technology50 GB – 400 GB NVMe SSD50 GB NVMe or 300 GB SSD
Traffic / Bandwidth4 TB to 32 TB32 TB Outgoing + Unlimited In
Control Panel & UIhPanel (Ultra Modern & Easy)cPanel, Plesk, Webmin, or CLI
Customer Support24/7 Live Chat & AI Support (Multi-lingual)Email Ticket Support (German Business Hours)
Best ForBloggers, WordPress Sites & Devs wanting easy UIHeavy Database, Docker, Game Servers & SysAdmins
Money-Back Guarantee30-Day Money-Back Guarantee14-Day EU Statutory Cancellation
Official LinksVisit HostingerVisit Contabo

The Most Common Cause of 502 Bad Gateway Outages

When WordPress traffic surges unexpectedly, web servers often crash with 502 Bad Gateway: server reached pm.max_children setting logged in PHP error files. When pm.max_children is set too low, incoming visitor requests queue up and time out. When set too high, PHP child processes consume more physical memory than the server possesses, invoking the Linux kernel's OOM Killer to terminate MySQL.

The Exact Mathematical Formula for Sizing PHP-FPM Pools

To determine optimal pool sizing, execute this diagnostic command to find the average memory footprint of a single PHP-FPM worker process on your active WordPress site:

ps --no-headers -o "rss,cmd" -C php-fpm8.3 | awk '{ sum+=$1; n+=1 } END { if (n>0) print sum/n/1024 " MB" }'

On typical WordPress sites, an active worker consumes between 50 MB and 85 MB.

The Calculation Formula

pm.max_children = (Total Server RAM - RAM Reserved for OS & Database) / Average PHP Process Size

For an 8GB RAM VPS (e.g. Contabo VPS 1 or Hostinger KVM 2):

  • Total RAM: 8,192 MB
  • Reserved for OS & MySQL Buffer Pool: ~3,000 MB
  • Available for PHP-FPM: ~5,192 MB
  • Calculation: 5,192 MB / 65 MB = ~80 children

Production Pool Configuration

Edit your pool configuration in /etc/php/8.3/fpm/pool.d/www.conf:

pm = dynamic
pm.max_children = 80
pm.start_servers = 15
pm.min_spare_servers = 10
pm.max_spare_servers = 25
pm.max_requests = 1000

Restart PHP-FPM with sudo systemctl restart php8.3-fpm to activate your stable, high-concurrency worker pool.

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Prevents server crashes by eliminating memory exhaustion from runaway PHP child processes
  • Calculates the exact theoretical maximum concurrency your hardware can safely sustain
  • Maximizes CPU utilization and cuts latency on dynamic WooCommerce checkouts

Drawbacks (Cons)

  • Overestimating worker memory consumption causes unused RAM to sit idle
#PHP-FPM#WordPress Optimization#Server Tuning#Nginx#VPS Performance
Marcus Sterling

Written by Marcus Sterling

WordPress Core Specialist

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads