What is PM.MAX_CHILDREN and PM.MAX_REQUESTS?

What is PM.MAX_CHILDREN and PM.MAX_REQUESTS?

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Decoding PHP-FPM Limits: pm.max_children and pm.max_requests

When a production server suddenly stops serving requests, the error log is often the only clue left. A common message that appears in this scenario is: server reached pm.max_children setting (70), consider raising it. This indicates that PHP-FPM, the FastCGI Process Manager responsible for handling HTTP requests in most Laravel and PHP deployments, has hit a hard ceiling on how many simultaneous worker processes it can spawn.

Understanding these limits isn't just about tweaking a number; it requires grasping how PHP-FPM manages memory and concurrency. The configuration block typically looks like this:

pm.max_children = 70
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 35
pm.max_requests = 5000

Let's break down what each parameter actually controls and why hitting the limit causes downtime.

The Anatomy of pm.max_children

The pm.max_children directive sets the absolute upper limit on the number of child processes PHP-FPM will create to handle incoming requests. In your scenario, this value is set to 70. Once all 70 slots are occupied, any new request hitting the server cannot be processed by a worker process.

Instead of crashing the web server immediately (which would result in a 502 Bad Gateway error), PHP-FPM returns a standard response code: 503 Service Unavailable. The default body for this response is often simply "The server is busy," which can leave users wondering why their site is down.

This limit exists primarily for memory protection. Each child process loads the PHP interpreter, your application code, and includes files like .htaccess or framework configurations into memory. If you have a large Laravel installation with many autoloaded classes, each process might consume 100MB to 200MB of RAM. With only 70 slots, a sudden traffic spike could exhaust the available RAM on the server before any new process is spawned to handle it.

Tuning Process Pools for Stability

The other parameters in your config define the behavior of the worker pool relative to that maximum. pm.start_servers determines how many processes are launched immediately when PHP-FPM starts. If you have 20 start servers, the server can handle a burst of traffic instantly without waiting for new processes to spawn.

pm.min_spare_servers and pm.max_spare_servers control the idle pool. PHP-FPM will try to maintain at least 20 idle processes ready to work and up to 35 if memory permits. This is crucial for latency-sensitive applications. However, these values are dynamic; they fluctuate based on load and memory availability.

If you are experiencing frequent "server busy" errors, the immediate fix is increasing pm.max_children. However, simply raising this number without checking your server's total available RAM is a recipe for swapping or crashing the entire OS. A safer approach is to calculate the limit based on your server's RAM and the average memory footprint of a single PHP process. If you are unsure, tools like pm.status.php can help you monitor current process usage in real-time.

The Role of pm.max_requests

While pm.max_children handles concurrency, pm.max_requests addresses resource exhaustion caused by long-running processes. By default, or in your specific case with a setting of 5000, PHP-FPM will terminate a child process after it has handled that many requests and then spawn a new one to take its place.

This mechanism is vital for security and stability. Even if you don't hit the pm.max_children limit, a single long-running script or a memory leak in your application code can cause a process to consume excessive resources over time. Once a process hits the request count limit, it dies gracefully. This prevents a single compromised or buggy process from holding onto stale data in memory, potentially affecting other requests.

Without setting pm.max_requests, processes might run indefinitely until they are killed by the operating system due to Out-Of-Memory (OOM) errors, which is far less desirable.

Implementation and Monitoring

To adjust these settings, you edit the php-fpm.conf or the included pool files (often named www.conf). After making changes, you must restart the service:

sudo systemctl restart php8.1-fpm
# Or on older systems:
sudo service php7.4-fpm restart

It is also advisable to monitor these metrics using tools like NewRelic, Datadog, or by polling pm.status.php directly from your browser. If you see the max_children count consistently hitting 100%, it indicates that your concurrency model is saturated, and either your infrastructure needs more RAM or your application needs optimization to handle traffic more efficiently.

For production environments running Laravel, where queue workers often run alongside the web server, ensure your worker processes are configured separately with their own pm.max_children settings to avoid contention for system resources.

Our network