Right-size from percentiles instead of averages

short · 40 min · Objective 1.7

Task

Take a week of utilisation data and size an instance from it twice: once from the mean, once from the 95th percentile with headroom. The gap between the two answers is the point of the exercise.

Steps

  1. Generate a week of hourly CPU figures into lab/util.csv with a realistic shape: low overnight, a daily working peak, a weekend dip, and one much larger spike representing month-end.
  2. Calculate the mean, the median, the 95th percentile and the maximum. Record all four in lab/sizing.md.
  3. Size the instance from the mean, and from the 95th percentile plus 25% headroom. State both answers and the ratio between them.
  4. Write what would happen at month-end under each sizing, and state which figure you would defend to a finance team and which to an on-call engineer.
  5. Add a paragraph on the metric this dataset does not contain and which the provider cannot see without an agent, and why ignoring it is how a database gets moved onto an instance that cannot hold its working set.

Verify

grep -Eci 'percentile|p95' lab/sizing.md
grep -Eci 'mean|average' lab/sizing.md
grep -Eci 'memory' lab/sizing.md
awk -F, 'NR>1 {n++} END {print n" hourly reading(s)"}' lab/util.csv

At least 168 readings for a full week, and memory must be named -- it is the measurement the console does not give you and the one that causes the expensive mistake.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.