Troubleshooting guide

Troubleshooting Guide: PHP-FPM High Memory Usage

Use this guide to work through the most likely causes, gather useful evidence and make production-safe changes without turning a small problem into a larger outage.

Remote consulting availableCommercial platformsService: PHP-FPM Performance Tuning Consulting
PHP-FPMmemory usageWordPressWordPress infrastructureLinux

What this problem usually means

PHP-FPM can use too much memory when the pool allows too many workers, individual requests are heavy, or application code/plugins consume more RAM than expected. Increasing limits without sizing the pool can cause swapping and outages.

Production caution: Do not simply raise PHP memory_limit or max_children on a small server. That can make the site crash harder when traffic increases.

Common symptoms

  • Server RAM fills during traffic spikes
  • 502/504 errors appear under load
  • PHP-FPM processes consume large memory each
  • Swap usage increases and the site slows down
  • WordPress or WordPress infrastructure becomes unstable

Common causes

  • pm.max_children is too high for available RAM
  • Heavy plugins, themes or long-running PHP jobs
  • PHP memory_limit set high across many workers
  • Slow external API calls keeping workers busy
  • No object cache or inefficient database queries
  • Traffic spikes from bots or crawlers

Safe first checks

These checks are intended to assist identify the direction of the issue. Always adjust paths, solution names and commands for your environment.

Show PHP-FPM processes

ps -ylC php-fpm* --sort:rss | tail

Check pool config

grep -R "pm.max_children\|memory_limit" /etc/php/*/fpm/ -n

Check memory pressure

free -m && vmstat 1 5

Review slow logs if enabled

grep -R "slowlog\|request_slowlog_timeout" /etc/php/*/fpm/pool.d/ -n

Typical fixes

  • Calculate safe PHP-FPM worker count from real memory usage
  • Use ondemand or dynamic process operations where appropriate
  • Enable and review PHP-FPM slow logs
  • Reduce plugin/theme load and background jobs
  • Add Redis/object caching where useful
  • Block abusive bot traffic at NGINX or Cloudflare

When to get assist

Get assist if the system is production-facing, customer data is involved, backup processes are uncertain, or the issue affects revenue, security hardening or uptime. We can review the logs, confirm the cause and quote a fixed-scope fix where appropriate.

Need this fixed?

Get remote engineering help for this issue.

Fixed engineering help starts from $499. Emergency incident engineering assistance is $199/hr with a minimum window.

Contact us

Related guides