PHP-FPM monitoring · pools, slow log, workers

PHP-FPM monitoring on one page, with the cause first.

WatchLog reads each pool’s status page, and PHP-FPM’s logs and workers on the machine. One scroll says which pool ran out of workers, what they wait on and what they hold open, on Kubernetes, Docker and Linux servers.

No user, no password. No log line leaves the machine. Open source.

WatchLog’s PHP-FPM page while a pool runs short of workers: Right now says pool www is nearly out of workers, slow requests wait in execute() on the database orders-db and the workers hold its connections, over the Workers chart with the rollout that started it.(opens the picture larger)
Right now

The answer first.

The top of the page is one sentence: which pool is running out of workers, how many are busy and how many requests wait, what the slow requests wait on, and what the workers hold open. When nothing is wrong, it says that.

  • Four numbers: busy workers against the limit, requests waiting, requests a second, p95.
  • See what broke scrolls to the cause; Open goes to the workload behind it.
  • A rollout, or a deploy your scripts send to the events API, is named when it came just before.
Right now on WatchLog’s PHP-FPM page while it fails: pool www is nearly out of workers, 6 of 8 busy, slow requests wait in execute() on the database orders-db, with Open orders-db and the four numbers.(opens the picture larger)
Failing: the pool, what its workers wait on, and the rollout before it.
Right now on WatchLog’s PHP-FPM page when it is calm: Everything is answering, with busy workers, requests waiting, requests a second and p95.(opens the picture larger)
The same PHP-FPM before the rollout: everything answers.
The chart

One chart, four views.

Workers, Requests, Request time and Memory share one chart, with rollouts and workers killed or crashed as pills on it. Drag across it to choose a period: every section and drawer below follows.

  • Workers: busy and idle against pm.max_children, and the requests waiting.
  • Hover for each series; click a legend item to show it alone.
  • Shift and the arrow keys choose a period from the keyboard.
Where the work goes

From the URL to what the workers wait on.

The URLs of the Nginx in front, or the scripts the workers are busy in, on the left; the pools in the middle; what the workers hold open on the right, each named by its workload. A monitored database at its connection limit is red.

  • Hover a ribbon for its share; click a script or a pool to open it.
  • Connections are matched to the pool’s own workers, never to another process of the same user.
  • When WatchLog can’t tell them apart, it says so and draws no ribbon.

URLs need the Nginx in front monitored; the right column needs the agent where PHP-FPM runs.

Slow requests and causes

Where slow requests wait.

Slow requests come worst first: each script with the function its slow requests were in, as database, network, sleep or PHP, and its share. Beside them, why workers are busy: waiting on the database or the network, requests stopped at the timeout, workers killed or crashed.

  • The slow log is classified on the machine: no line is stored or sent.
  • Each cause with its share and since when.
  • All slow requests opens the whole list, searchable and sortable.

Slow requests need the slow log; in a container PHP-FPM needs SYS_PTRACE to write it.

Slow requests and Why workers are busy on WatchLog’s PHP-FPM page: index.php slow in execute() on the database, and waiting on the database as the cause with its share.(opens the picture larger)
All slow requests in WatchLog’s wide drawer: every script and function with its kind, count, share and since when.(opens the picture larger)
All slow requests: search it, sort it.
Drawers

Click anything, stay on the page.

Every row, ribbon and card opens a drawer over the page, and the drawer is in the address, so you can send the link. Esc closes it; ↑ and ↓ move to the previous or next row.

  • A pool: its cause first, workers, queue, requests, request time, memory, settings and slow functions.
  • A script: where its slow requests were, and the workers busy in it.
  • Its chart works like the page’s: hover, the arrow keys, drag to choose a period.
Everything else

Healthy things stay small.

Pools, Memory, Listen queue and Restarts are one card each: one number, one sentence and a bar. A card turns amber or red only with a finding.

  • Memory: the workers’, the largest worker and the largest request.
  • Restarts: what PHP-FPM logged, out of workers, stopped, killed, crashed or recycled.
  • Listen queue: requests waiting for a worker against the backlog.
Setup

It tells you what it can’t see.

The Setup view lists what WatchLog reads: the status page and its full view, the error log, the slow log, the workers, their connections and the configuration, each with its state and what a missing one costs, and the one step that adds the most.

  • Two lines in the pool turn the status page on.
  • The slow log says where slow requests wait.
  • You reload PHP-FPM yourself; WatchLog never writes its configuration.
The pool’s configuration, e.g. /etc/php/8.3/fpm/pool.d/www.conf
pm.status_path = /status
; when the pool listens on a socket: a status listener on loopback
pm.status_listen = 127.0.0.1:9001
; optional: where slow requests wait
request_slowlog_timeout = 1s
slowlog = /var/log/php-fpm/$pool.slow.log

Then sudo systemctl reload php8.3-fpm. In a container, add SYS_PTRACE to PHP-FPM’s container for the slow log. What each line adds.

Light or dark, desk or phone

The same answer on a phone.

The page comes in a light and a dark theme, and on a phone it keeps the same order: the answer first, then the chart and the rest.

Alerts that are already written

On from the first minute.

Press Monitor and these are created; you tick the ones that start on. Each goes to Slack, Telegram, email or a webhook, and says what, where and which pool.

  • PHP-FPM reached pm.max_childrencritical
  • Requests waiting for a worker for 5 minutescritical
  • Workers above 90 % busy for 10 minuteswarning
  • The service unreachable, or slow to connectcritical
Setup

Two lines in the pool. No user, no password.

  1. Install the WatchLog agentOne command on a server, or one Helm chart on a cluster.
  2. WatchLog finds PHP-FPMBy its unit or its pools on a server, and from the official image’s -fpm tags and bitnami/php-fpm in Docker and Kubernetes. It appears under Applications.
  3. Press MonitorNo user, no password. With the status page on, the page and its alerts start at once.
Platform
# The image’s pool configuration (www.conf)
pm.status_path = /status
# /etc/php/8.3/fpm/pool.d/www.conf, or the image’s www.conf
pm.status_path = /status
pm.status_listen = 127.0.0.1:9001

The status page gives workers, the queue, requests and request time. The slow log adds where slow requests wait; the agent adds the workers’ memory and what they hold open.

Installed with apt or dnf on a Linux server? WatchLog finds PHP-FPM by its unit and reads its configuration and logs where they are. It never writes the configuration or reloads PHP-FPM. Applications on Linux servers.

What each line adds →
Compared

Against an exporter and dashboards.

WhatWatchLogAn exporter and dashboards you build
Time to the first chartMinutesHours: an exporter, then dashboards
Where slow requests waitThe function and its kind, from the slow logThe slow log, searched by hand
What the workers hold openEach destination, named by its workloadNot in the status page
Where log lines goNowhere: counted, then droppedTo a log store, kept and paid for
Default alertsThree, written for youRules you write
Kubernetes, Docker and Linux serversAll threeDepends on your setup
Reads URIs, query strings and request bodiesNeverWhatever the log holds
Ask your AI

Ask your AI about PHP-FPM.

Claude and ChatGPT read the same facts through WatchLog’s MCP server, read-only: which pool ran out of workers, where slow requests wait and what the workers hold open.

Connect your assistant →

Why is checkout slow?

get_application · explain_problem

Pool www of shop/storefront-php has run out of workers: its slow requests wait in execute() on the database shop/orders-db, which is at its connection limit.

An example on Kubernetes, written from the docs.
Questions

PHP-FPM monitoring, answered.

Which PHP-FPM does it work with?
PHP 7.4 and later, installed from a package on a Linux server, in Docker or on Kubernetes, with one pool or many.
What do I have to change?
Two lines in each pool, pm.status_path and, when the pool listens on a socket, pm.status_listen; then reload PHP-FPM. The slow log is optional and says where slow requests wait.
Does WatchLog collect my PHP-FPM logs?
No. The agent reads the error and slow logs on the machine and turns them into counts there: an event from a fixed list, or the pool, script and function a slow request was in. Then the line is dropped: no line leaves the machine and none is stored.
What does it never read?
URIs, query strings, request bodies and the user. Behind a front controller every URI is /index.php?…, so URLs come from the Nginx in front when you monitor it. On Kubernetes the configuration is a ConfigMap, which WatchLog never reads.
Why does the slow log need SYS_PTRACE in a container?
PHP-FPM traces its own workers to write the slow log. Docker and Kubernetes drop that capability by default, so PHP-FPM logs failed to ptrace(ATTACH) and writes nothing. The Setup view says when that is the case.
What does it cost on the machine?
Counting one line of PHP-FPM’s log takes about 0.6 µs; the process and connection scan runs once a minute per PHP-FPM. Each PHP-FPM sends at most 50 slow-log series, 20 destinations and a few series per pool.
Is it free?
The open-source edition is free without limits. WatchLog Cloud is free for 5 servers or nodes.

See your own PHP-FPM in five minutes.

Free on WatchLog Cloud for 5 servers or nodes, or run it yourself, open source.