Right-size from percentiles instead of averages
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
- Generate a week of hourly CPU figures into
lab/util.csvwith a realistic shape: low overnight, a daily working peak, a weekend dip, and one much larger spike representing month-end. - Calculate the mean, the median, the 95th percentile and the maximum. Record all four in
lab/sizing.md. - Size the instance from the mean, and from the 95th percentile plus 25% headroom. State both answers and the ratio between them.
- 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.
- 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.