PHP-FPM Worker Capacity Planning Checklist

halfbrain_logo512adminJune 19, 2026
4 lượt xem

PHP-FPM Worker Capacity Planning Checklist

PHP-FPM worker settings decide how many PHP requests can run at the same time. Too few workers can cause slow responses. Too many workers can exhaust RAM and crash the VPS.

Core principle

PHP-FPM capacity is limited by memory. Each worker consumes RAM. max_children should be based on available memory, average worker memory and other services on the server.

Checklist

  1. Check total server RAM.
  2. Check current memory usage.
  3. Estimate memory used by MySQL, Nginx and other services.
  4. Measure average PHP-FPM worker memory.
  5. Check current pm.max_children.
  6. Check whether PHP-FPM reaches max children.
  7. Adjust worker count conservatively.
  8. Restart PHP-FPM after config validation.
  9. Monitor RAM and response time after change.
  10. Document capacity estimate.

Reusable lesson

This applies to WordPress traffic spikes, WooCommerce, plugin-heavy sites, API endpoints and small VPS capacity planning.

Checklist Type Monitoring
Level Intermediate
Risk Level High Risk
Estimated Time 45–90 minutes

When to Use This Checklist

Use this checklist when tuning PHP-FPM on a WordPress VPS or diagnosing slow PHP responses, 502, 504 or memory pressure.

Required Tools

SSH access, PHP-FPM pool config, top or ps, memory data, PHP-FPM logs, traffic context

Before You Start

Do not raise pm.max_children without checking RAM. More workers can make the server slower or unstable.

Structured Checklist Steps

  1. Check total RAM.
  2. Check used RAM.
  3. Estimate other service memory.
  4. Measure worker memory.
  5. Check max_children.
  6. Check max children warnings.
  7. Tune conservatively.
  8. Restart PHP-FPM.
  9. Monitor after change.
  10. Document estimate.

Rollback Plan

If tuning causes memory pressure or OOM events, restore the previous pool config and reduce max_children before retesting.

Common Mistakes

  • Increasing workers blindly.
  • Ignoring MySQL memory.
  • Not measuring worker size.
  • Forgetting traffic spikes.
  • No monitoring after tuning.

Related Commands

free -h
ps -ylC php-fpm8.2 --sort:rss
ps aux | grep php-fpm
grep -R "pm.max_children" /etc/php/*/fpm/pool.d/
sudo tail -n 100 /var/log/php8.2-fpm.log
sudo systemctl restart php8.2-fpm

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *