critical
5.1.1.PHP-FPM down
PHP-FPM instance is down on {{ $labels.instance }}
# 1m delay allows a restart without triggering an alert.
- alert: Php-fpmDown
expr: 'phpfpm_up == 0'
for: 1m
labels:
severity: critical
annotations:
summary: PHP-FPM down (instance {{ $labels.instance }})
description: "PHP-FPM instance is down on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"critical
5.1.2.PHP-FPM flapping
PHP-FPM on {{ $labels.instance }} changed state {{ $value | printf "%.0f" }} times in the last 10 minutes.
# Catches a crash-looping service, which the down rule misses because each successful scrape resets its for: timer.
# 4 changes means at least 2 down/up cycles in 10m; one outage followed by a recovery counts only 2.
- alert: Php-fpmFlapping
expr: 'changes(phpfpm_up[10m]) >= 4'
for: 0m
labels:
severity: critical
annotations:
summary: PHP-FPM flapping (instance {{ $labels.instance }})
description: "PHP-FPM on {{ $labels.instance }} changed state {{ $value | printf \"%.0f\" }} times in the last 10 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"warning
5.1.3.PHP-FPM max-children reached
PHP-FPM reached max children on {{ $labels.instance }} ({{ $value }} times in the last 5m)
- alert: Php-fpmMax-childrenReached
expr: 'sum(increase(phpfpm_max_children_reached_total[5m])) by (instance) > 3'
for: 0m
labels:
severity: warning
annotations:
summary: PHP-FPM max-children reached (instance {{ $labels.instance }})
description: "PHP-FPM reached max children on {{ $labels.instance }} ({{ $value }} times in the last 5m)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"warning
5.1.4.PHP-FPM listen queue saturation
PHP-FPM listen queue on {{ $labels.instance }} is at {{ $value | humanizePercentage }} of the socket backlog length, new connections may soon be queued or dropped.
- alert: Php-fpmListenQueueSaturation
expr: 'sum(phpfpm_listen_queue_connections) by (instance) / sum(phpfpm_listen_queue_length_connections) by (instance) > 0.8'
for: 5m
labels:
severity: warning
annotations:
summary: PHP-FPM listen queue saturation (instance {{ $labels.instance }})
description: "PHP-FPM listen queue on {{ $labels.instance }} is at {{ $value | humanizePercentage }} of the socket backlog length, new connections may soon be queued or dropped.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"warning
5.1.5.PHP-FPM busy process ratio high
{{ $value }}% of PHP-FPM processes are active (busy) on {{ $labels.instance }}, the pool is approaching its max_children capacity.
- alert: Php-fpmBusyProcessRatioHigh
expr: '(sum(phpfpm_processes_total{state="active"}) by (instance) * 100) / sum(phpfpm_processes_total) by (instance) > 80'
for: 5m
labels:
severity: warning
annotations:
summary: PHP-FPM busy process ratio high (instance {{ $labels.instance }})
description: "{{ $value }}% of PHP-FPM processes are active (busy) on {{ $labels.instance }}, the pool is approaching its max_children capacity.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"warning
5.1.6.PHP-FPM slow requests ratio
{{ $value | humanizePercentage }} of accepted connections on {{ $labels.instance }} exceed request_slowlog_timeout, indicating degraded PHP-FPM response times.
# If this fires too often or too rarely, tune your PHP-FPM request_slowlog_timeout setting (which defines what counts as "slow") rather than this 10% ratio threshold.
- alert: Php-fpmSlowRequestsRatio
expr: 'sum(rate(phpfpm_slow_requests_total[5m])) by (instance) / sum(rate(phpfpm_accepted_connections_total[5m])) by (instance) > 0.1 and sum(rate(phpfpm_accepted_connections_total[5m])) by (instance) > 0'
for: 5m
labels:
severity: warning
annotations:
summary: PHP-FPM slow requests ratio (instance {{ $labels.instance }})
description: "{{ $value | humanizePercentage }} of accepted connections on {{ $labels.instance }} exceed request_slowlog_timeout, indicating degraded PHP-FPM response times.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"