Metric values: max, min, average, median and 99ile

Published

Updated

Reviewedbyfl

⏱️

One stuck request, three answers.

Each metric chart shows a few values per bar and per time frame, such as max, last or the average. What a value means depends on whether the metric counts things, samples a level, or times requests.

Bar, box and summary

  • One bar: the values of that hour or day.
  • The box: the values for the whole time frame, or for a selected bar.
  • The summary page: one headline value per metric.

Each group page lists the values of its metrics: storage & traffic, MySQL, PHP, jobs, errors.

Labels by type of metric

A metric either counts things, such as requests or bytes, samples a level, such as storage or memory, or times PHP requests. A label means something slightly different for each:

LabelCountsStorage, memory, OPcachePHP response time
sumAll counted in the period––
maxHighest barHighest sampleSlowest request
minLowest barLowest sample–
last–Latest sample–
avg–Average of the samplesAverage request
typical peak–Median sample–
med––Middle request: half were faster
99ile––99 of 100 requests were faster

The dashboard shows a sum without a label, so the bare number under "404 errors" is their count.

For counts, a bar is the sum of its samples, so max is the busiest hour or day. For storage, last against max tells whether the size dropped during that day. For memory, typical peak against max tells whether memory stayed low with a few spikes, or ran high all the time.

Average, median and 99ile

The "Measure" select of the PHP response time chart sets which value the bars show below max. The example for all three: an hour with 1,000 requests, 999 took 100 ms, and one was stuck for 60 s.

Average

All durations added up, divided by the number of requests. This is the default measure, and it is exact.

  • In the example: 999 × 100 ms + 60,000 ms = 159,900 ms, divided by 1,000 requests: 160 ms.
  • One stuck request lifts the average of the whole hour from 100 ms to 160 ms.
  • Multiplied by the number of requests, the average gives the PHP time the hour used up.

Median

Sort the requests from fast to slow and take the one in the middle. Half of the requests were faster, half slower.

  • In the example: the 500th request, 100 ms. With or without the stuck request, the median stays at 100 ms.
  • The median shows what a typical request took. It does not depend on how slow the slow requests were.

99ile

The 99th percentile. Sort the requests from fast to slow and take the one at 99%: 99 of 100 requests were faster, one in 100 slower.

  • In the example: the 990th request. Only one request was slow, so the 990th took 100 ms, and the 99ile is 100 ms.
  • Were 20 requests stuck, the 990th would be one of them, and the 99ile would jump to 60 s.
  • A slow kind of request, such as an uncached page or a heavy export, shows up in the 99ile once it makes up more than one in 100 requests. The average spreads it over all requests, the median misses it.

Estimates

Average and max are exact. The median and the 99ile are estimates, as the load balancer counts requests per duration range instead of keeping each duration:

  1. The platform adds up the counts of the ranges, from fast to slow, until it reaches the 500th request for the median or the 990th for the 99ile.
  2. That request lies somewhere inside the last range added.
  3. The platform assumes the requests in that range are spread evenly and picks the matching point.

The estimate never exceeds max. The wider the range, the rougher the estimate.

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗