To check whether PHP requests are waiting for an available worker, first check the Listeners of the affected PHP-FPM pool. Assign the slow route to its FastCGI target and, within the same time frame, compare the socket usage with the available workers and the web server logs. If the listener shows connections that haven’t yet been accepted, a backlog is visible there. A zero in the FPM status or a 504 error alone does not settle the matter, however. Only when you know when and where connections are waiting can you determine whether increasing the buffer size will actually help.
First, find the affected pool
Start with a specific slow URL and the virtual host that handles it. Check the web server configuration to see where this route forwards its PHP requests. In nginx, the destination is specified in fastcgi_pass; if the directive refers to a named upstream group, resolve the name down to the actual endpoints in question. Especially when multiple websites use the same server, the hostname alone does not indicate which pool is processing the request.
Equalize that FastCGI Target under the Pool Directive listen . For a Unix socket, note the full path; for TCP, note the address and port. Also note the pool name and version of the FPM service that serves this target. The php -v The version shown is for the command-line installation and does not indicate the FPM version of the website.
Check whether the FPM status output lists the expected pool. Then set a common time window with a time zone for status values, socket monitoring, and web server logs. If you compare a slow request at 2:03 p.m. with a measurement taken at 2:10 p.m., workers may have become available again in the meantime. This does not contradict the possibility of a brief bottleneck at 2:03 p.m.
If you lack shell access or pool data in your managed hosting environment, ask the provider for metrics specific to the incident rather than a general statement about server utilization. This information helps both parties identify the appropriate metrics for the affected request:
- Specify the affected domain and route; determine the assignment to the FPM pool, the FastCGI target, and the FPM version in use.
- Specify the incident period, including the date, time, and time zone.
- Retrieve queue occupancy as well as active and available workers for this time period; request corresponding upstream errors, including timestamps and error phases.
What's Actually in the PHP-FPM Backlog
If a request requires PHP, the web server forwards it via FastCGI to the pool's listener. The listener is the socket where FPM accepts new connections. If a connection is already ready to be accepted but has not yet been accepted by a worker, it may be in the queue for that socket. It is precisely this pending FastCGI connections refer to the list backlog.
For a TCP listener on Linux, the backlog consists of fully established connections that have not yet been closed via accept were accepted. Connections with an incomplete TCP handshake are not included. A successful connection establishment therefore does not mean that FPM has already begun processing the request: From the web server's perspective, the connection may already be established, while it is still waiting to be accepted by the listener.
The designation "PHP Queue“ would be too broad a definition. An HTTP request waiting to be forwarded—either in front of the web server or already inside it—has not yet reached this measurement point. Conversely, a PHP request that a worker is already processing is no longer visible there. If your script is waiting for a database query or an external service, the worker remains busy without that request itself being counted as part of the socket queue.
Both can happen at the same time: A slow database ties up workers, and incoming connections then back up at the listener. The backlog then shows, where the new connections await, but not why the workers remain occupied for so long. If, on the other hand, only a few active requests slow down and the pool still has available workers, the website may respond sluggishly even without measurable congestion at the listener. Response time alone does not distinguish between these cases.
Distinguish Between Wait Buffers and Worker Limits
With listen.backlog You specify the backlog size that FPM requests from the operating system. This directive affects the Waiting buffer on the listener, not the number of PHP processes. Under Linux, the limit is somaxconn the value that the kernel assigns to the call listen accepted. If the requested backlog exceeds this limit, the kernel may silently limit it. A successful FPM startup therefore does not confirm that the listener is actually using the configured size.
The upper limit for the number of requests being processed simultaneously in the pool, on the other hand, is set at pm.max_children. This Worker Limit It is neither the number of available processes nor the number of requests per second. If all available workers are busy, the time it takes for one to accept a connection again depends on the duration of their current tasks. The size of the socket queue does not affect this.
Imagine two otherwise identical pools experiencing the same short-term load spike. The pool with the larger backlog can accommodate more incoming connections in the queue while the workers process their current requests. This does not speed up the processing of current requests. As soon as the spike ends, the pool can gradually accept the waiting connections. The larger buffer can thus prevent connection errors during short spikes, but this may come at the cost of longer wait times.
If the overload persists, even a larger buffer will fill up when more work arrives than the pool can handle. In and of itself, a larger backlog does not increase throughput. If the additional wait time is unacceptable to the application, the appropriate options are fewer requests arriving at the pool, shorter processing times, or more sustainable processing capacity. Whether a larger buffer is worthwhile therefore depends on how quickly the pool clears the backlog and how much additional latency is acceptable.
Reading Queue and Worker Values Correctly
Status checks and internal measurements occur at two different times: PHP 8.4.0 transfers queue values to the scoreboard during periodic pool maintenance. More frequent HTTP status checks do not trigger additional socket measurements. Even `max_listen_queue` may miss spikes between internal measurement points. Record the retrieval time and pool runtime; a high maximum value may have already occurred before the incident.
| Signal | What it shows | What It Doesn't Prove | Next Synchronization |
|---|---|---|---|
| listen queue | Reported occupancy; if there is an entry error, "0" may be accepted | That a reported "0" indicates an empty listener or that no congestion occurred between internal measurement points | Synchronize direct socket measurement and internal sampling |
| max listen queue | Highest internally recorded occupancy since launch | Actual peaks between internal measurement points, time of occurrence, or duration of the traffic jam | Compare Previous Values, Sampling, and Socket Measurements |
| list queue length | According to the PHP Manual, queue size; the tcpi_sacked value initially adopted from the Linux TCP_INFO path in PHP 8.4.0 | Current usage, specific rejection threshold, or a zero limit for Unix sockets or query errors | Record socket limits separately; check the build and socket type |
| idle processes / active processes | Reported number of unemployed and employed workers | Why workers are busy or whether there are connections waiting on the socket | Process counts and listener allocation within the same time window |
| max children reached | Historical Reference to the Boundary of the Process | Whether the pool is currently at full capacity or the backlog is full | Process mode, current number of processes, available workers, and listener allocation |
| start time / start date | Start time or duration | That historical values remain comparable even after a reset | Mark restart limits in the measurement series |
In the PHP 8.4.0 release source code examined here, the queue detection for TCP pools is called; Unix sockets do not follow this path. If the query fails, the periodic evaluation sets the current queue to zero. A zero can therefore indicate an empty queue, a missed peak, or a detection threshold. First, check the actual FPM build and socket type, and compare them with a real-time direct observation of the socket. Do not apply the findings from this release universally to other versions or vendor packages.
According to the PHP manual, `listen queue len` is the size of the queue. In the Linux TCP_INFO path of PHP 8.4.0, the initialization value for the `tcpi_sacked` field is set upon a successful query. This line of source code does not indicate current usage or an actual rejection threshold. Even with Unix sockets or query errors, a value of null does not indicate a limit of zero. For comparison, record the queue and the reported backlog separately via the socket diagnostic path documented here.
An increase of max children reached "During the incident period" is a supplementary note, not a live display. In mode static The process count is fixed. Do not wait for the counter to increase to detect a fully utilized pool. The key factors are the available and free workers, as well as the concurrent socket usage. For regular monitoring, see the PHP-FPM Status Page for Performance Analysis.
Monitor the listener directly under load
If you have shell access to the Linux system running the FPM listener, you can monitor the socket independently of the status page. For containers, the query must be able to access the network namespace where the listener resides. The following commands read the socket status without changing the configuration. The first line shows listening TCP sockets; the second shows listening Unix sockets.
Assign the TCP address and port or Unix socket path to the FastCGI target and select the appropriate LISTEN line. On Unix, it must be the listening stream line (u_str): `ss -lxn` does not specifically filter for stream sockets. If a matching line is missing, no measurement value is available for the listener in question. An existing matching line with Recv-Q = 0 indicates an empty queue for that measurement point in time only if queue telemetry is available; a visible line alone does not prove this condition.
For the Netlink diagnostic path demonstrated here using Linux v6.12 and iproute2 v6.12.0, the following applies: For TCP-LISTEN, Recv-Q shows the fully established connections that have not yet been accepted, while Send-Q shows the reported maximum backlog. For listening Unix stream sockets, Recv-Q also shows the waiting connections, and Send-Q shows the reported socket backlog limit. These are connection counts, not data volumes or wait times. Evaluate the current usage separately from the limit. Other versions and diagnostic paths must be checked separately; a single snapshot does not indicate sustained utilization.
Capture multiple snapshots before, during, and after the peak load. Place the timestamped output next to the status values and web server logs. Use the same time zone. If there are multiple upstream targets, use only log entries for the target being monitored; otherwise, you may end up comparing the latency of one pool with that of an empty listener.
The Sampling rate determines what you can see. Between two queries, the queue can grow and then empty again. If the logs remain empty despite brief latency spikes, monitor a comparable time window more closely. Even a log showing a confirmed backlog does not indicate how long the connections have been waiting or which HTTP requests are affected.
Understanding a Short Load Spike
Suppose a store receives a brief surge in dynamic requests after sending out a newsletter. Before the spike, the pool shows available workers, and no waiting connections are visible at the listener. This is the starting point for the comparison: The existing processes were able to handle the incoming traffic at that time without any visible backlog.
During peak times, available workers become scarce. In setups with multiple sockets, the queue at the assigned listener grows. Taken together, these findings suggest that FastCGI connections sometimes arrive faster than workers can accept them. However, the utilization alone does not reveal how many milliseconds of wait time are attributable to a specific store request.
After the peak, the queue empties, and free workers become available again. Now check whether response times for the affected pages increased noticeably during the same time window or whether the logs show errors during FastCGI connection establishment. If the additional latency remains within an acceptable range and no connection errors occur, the brief spike alone is not a reason to increase the backlog.
If you're experiencing recurring spikes, it's worth taking a look at the Process Reserve. In mode dynamic FPM maintains a configurable number of free processes; when ondemand It starts workers as needed. If the queue builds up mainly while waiting for additional processes to become available, having a reserve of workers available early on can help, provided there is enough memory for them. A larger backlog has a different effect: It puts more connections on hold. This can be useful during brief spikes when connections would otherwise fail and the additional wait time is acceptable. However, it does not make a worker available any sooner.
Explain worker utilization during persistent congestion
If the socket queue remains occupied across multiple measurement points and there are no available workers at the same time, compare the current number of processes with the Process boundary pm.max_children. At dynamic and ondemand You can also use this to check whether the pool is already operating at its limit or is still below it. When static The number of processes is fixed. If there are no available workers and connections are waiting, the pool is at full capacity, even if max children reached remains unchanged. Therefore, prioritize the combined metric of process count, available workers, and socket utilization over the historical counter.
Reaching this limit does not yet explain why workers are not becoming available quickly enough. Compare which routes were accessed more frequently during the incident period and for which the response time increased. If the checkout process in particular is slowing down, analyzing it is a better starting point than looking at the average runtime of all PHP requests. Even a single slow route can tie up enough workers to slow down other pages in the same pool.
The FPM Slowlog helps you find jobs with long processing times. Once it's set up and request_slowlog_timeout If set, FPM can log a PHP backtrace of the current request once the threshold has been exceeded. This is a snapshot from the worker; it is not a measurement of the previous wait time at the socket. If the trace points to a database call or an external service, compare it with that service’s own runtimes and errors before determining the cause.
Which change will help depends on what’s tying up the workers. If avoidable requests are reaching the pool, a suitable cache can reduce the incoming load. If, on the other hand, long queries are driving up processing time, you should focus on the query or the affected service. A larger backlog does nothing to address either of these causes: it simply causes more connections to wait without processing them any faster.
You can consider adding more workers if the process limit is actually causing a bottleneck and the CPU, RAM, and downstream services still have capacity to spare. If the database is already at full capacity, additional workers can send even more queries to it simultaneously, thereby further delaying processing. The following section shows how to estimate the memory budget and the required level of parallelism separately: Capacity Planning for PHP-FPM Workers. After making a change, evaluate not only the queue but also response times and resource usage under comparable load.
502 and 504 without a visible queue
A reported queue of zero does not rule out a bottleneck. First, check whether the status query and socket measurement pertain to the FastCGI target that nginx uses for the affected route. A brief bottleneck may also occur between two requests. If socket monitoring indicates pending connections, a zero in the FPM status does not disprove this.
If you get a 502 or 504 error, the Error message in the nginx log more informative than the HTTP status alone. fastcgi_connect_timeout This concerns establishing a connection to the FastCGI target. fastcgi_read_timeout However, it limits the time between consecutive read operations, not the total response time.
Even a fast TCP connection establishment does not rule out waiting at the FPM listener. On Linux, the connection may already be fully established before a worker establishes it via accept assumes. Therefore, check the status at the listener at the time of the suspicious calls. A successful connection alone does not prove that FPM has already begun processing.
Compare the Nginx upstream times within the same load window. $upstream_connect_time tracks the connection establishment; a short duration does not rule out waiting for an FPM worker to accept the connection. $upstream_header_time extends only to the response header and does not isolate this wait time. $upstream_queue_time measures only Nginx’s own upstream queue, not the FPM socket. According to the vendor, the associated `queue` directive is part of the commercial offering. Check the edition and configuration: This metric is only meaningful if the upstream queue is properly supported and configured. Compare the times for the same target using worker and listener values.
| Signal | What it shows | What It Doesn't Prove | Next Synchronization |
|---|---|---|---|
| Timeout while establishing a connection | The setup for the FastCGI target was not completed in time | The fact that the FPM backlog was full | Check the target, accessibility, and listener assignment |
| Timeout while reading the response | The allowed interval between read operations has been exceeded | Whether the delay occurred before approval or during processing | Synchronizing Worker Status, Listener Allocation, and Slow Requests |
If the correctly assigned listener remains empty even upon closer inspection, while read errors are piling up, check for long-running or aborted PHP requests and their dependencies. If, on the other hand, connection errors are piling up, first check which target nginx actually attempted to reach and whether it was accessible. Without corresponding socket data, increasing the backlog would amount to making a change based on mere suspicion.
Maintain this status even under overload conditions
If the status query runs through the same FastCGI listener as the application traffic, it may have to wait or fail during periods of high load. This means that, especially at the peak of an incident, the most important pool values may be missing. Therefore, store a timeout or a failed retrieval as Measurement gap, not a queue value of zero. Otherwise, the time period will incorrectly appear in the monitoring as if the queue had been emptied.
pm.status_path Specifies the URI path for the status page, but does not separate the path to the pool. With pm.status_listen Instead, you can set up a separate FastCGI listener for status queries. The web server must specifically forward the status path to this listener, while application traffic continues to be directed to its original destination. This allows FPM to process status requests independently of the application pool, even when it is under heavy load.
Hold the Internal Status Access and restrict it to authorized monitoring and administration systems. The full view can reveal, among other things, request URIs and script paths. A separate listener does not automatically protect this information: If the web server also forwards the status path in the public virtual host, the output remains accessible from the outside without access restrictions. Therefore, verify not only that internal access is restricted, but also that public access is blocked.
While the system is running, verify that your monitoring tool uses the intended query path and that the response actually specifies the expected pool. Record successful requests and errors with timestamps so you can compare them later with socket metrics and web server logs. The separate status listener helps you continue monitoring during a bottleneck. It does not increase the application’s worker limit or its throughput.
Sources and Current State of Knowledge
Status of the research:
Last updated: November 20, 2026. The implementation findings apply to PHP 8.4.0, Linux v6.12, and iproute2 v6.12.0. Other releases and vendor packages must be tested separately. No measurements were performed on a production system.
https://man7.org/linux/man-pages/man2/listen.2.html
https://man7.org/linux/man-pages/man8/ss.8.html
https://www.php.net/manual/en/fpm.status.php
https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
https://www.php.net/manual/de/install.fpm.configuration.php
https://github.com/php/php-src/blob/php-8.4.0/sapi/fpm/fpm/fpm_process_ctl.c
https://github.com/php/php-src/blob/php-8.4.0/sapi/fpm/fpm/fpm_sockets.c
https://github.com/iproute2/iproute2/blob/v6.12.0/misc/ss.c
https://github.com/torvalds/linux/blob/v6.12/net/ipv4/tcp_diag.c
https://github.com/torvalds/linux/blob/v6.12/net/unix/diag.c
https://nginx.org/en/docs/http/ngx_http_upstream_module.html




