PHP metrics

Published

Updated

Reviewedbyfl

🐘

How PHP is doing.

The PHP group of the metrics tab shows how fast PHP answers, how many requests it gets, how much memory it uses, how full the OPcache is, and how often a process ran out of memory.

PHP response time

The load balancer times every PHP request. Per sample it keeps three things: how many requests fell into each duration range, the sum of all durations, and the slowest request. Every value of the chart is computed from these:

  • max: the slowest single request of the hour or day. It is exact. One stuck request sets it, so it often runs out of the chart.
  • avg, med, 99ile: one of the three, picked under "Measure", see average, median and 99ile.

The figures in the box are computed from all requests of the time frame at once, not from the bars. The fastest request is not recorded. The lines mark Fast, Good and Slow. See PHP processes.

The response time shows how long PHP took. The logs name the slow URLs, and an APM tool traces a slow request through the code, down to the query or function.

PHP requests

Requests that run PHP. A sample holds the requests answered since the sample before, a bar is the sum of its samples. Static files are counted separately, under static requests. See PHP processes vs page views.

PHP memory

The memory the PHP containers use. A sample holds the highest memory since the sample before, so it catches short spikes. A bar shows two values:

  • max: the highest sample of the hour or day. Compare it with the memory of the plan, drawn as a line.
  • typical peak: the median sample. Half of the samples were lower, half higher.

A typical peak far below the max means the memory stayed low most of the time and spiked now and then. See out of memory.

PHP OPcache

How full the OPcache is, the memory that holds compiled PHP code. A sample holds the highest fill level since the sample before, a bar the highest sample of the hour or day. Keep it below the Nearly full line. See keep OPcache below full.

OOM kills

PHP processes the system ended because the environment needed more memory than the plan has. A bar is the number of kills in that hour or day. See out of memory.

Labels and lines

The values each metric shows in one bar, for the time frame, and on the summary page, and the lines drawn across the chart:

MetricOne barTime frameSummaryLines
Web storagemax, last, min, avglast, max, min, avglastPlan sizes
Trafficsumsum, maxsum–
Static requestssumsum, max, minsum–
MySQL storagemax, last, min, avglast, max, min, avglastPlan sizes
PHP response timemax, avg / med / 99ilemax, avg / med / 99ileavgFast 150 ms, Good 350 ms, Slow 700 ms
PHP requestssumsum, max, minsum–
PHP memorymax, typical peakmax, typical peakmaxPlan sizes
PHP opcachemaxlast, maxlastNearly full 90%
OOM killssumsumsum–
Jobs memorymax, typical peakmax, typical peakmaxPlan sizes
Jobs OOM killssumsumsum–
404 errorssumsum, max, minsum–
500 errorssumsum, max, minsum–
503 errorssumsum, max, minsum–
504 errorssumsum, max, minsum–

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗