Baseline a real machine over a week and size its replacement
Task
Measure a machine you actually run -- your laptop, a home server, a lab VM -- over a period long enough to contain a real peak, then size a cloud instance from the measurements rather than from its specification sheet.
Steps
- Start a collector writing CPU, memory used, disk read and write rates and network throughput to
lab/baseline.csvevery minute, one row a minute under the headertime,cpu_pct,mem_used_mb,read_kbs,write_kbs,net_kbs.sar,collectlor a short shell loop aroundvmstatandiostatare all adequate -- but in a loop, keep the SECOND report:vmstat 60 2 | tail -1is the average over that minute. In the first report either tool prints, the CPU and I/O figures are averages since boot, and a loop that keeps it records nearly the same number all week, peaks included. - Leave it running for at least four days, including a weekend if the machine's use varies by day.
- Compute the 50th, 95th and 99th percentile and the maximum for each metric. Record them in
lab/sizing.mdbeside the machine's actual installed specification. - Choose an instance family and size from the numbers, naming the metric that BINDS -- the one closest to its limit -- and stating the headroom you added.
- Write the assumptions paragraph: the window you measured, what it did and did not contain, the growth rate you assumed, and anything you estimated rather than measured.
Verify
awk -F, 'NR>1 {n++} END{print n+0" observation(s)"}' lab/baseline.csv
awk -F, 'NR>1 {print $2}' lab/baseline.csv | sort -u | wc -l # distinct CPU values
grep -Eci 'p95|95th' lab/sizing.md
grep -Eci 'binds|binding|constraint' lab/sizing.md
grep -Eci 'assum' lab/sizing.md
At least 5760 observations -- four days at one a minute -- and hundreds of distinct CPU values. A handful of distinct values over thousands of rows is the since-boot average, recorded again and again. (The second line assumes CPU is your second column; adjust $2 to match your header.) A sizing with no assumptions paragraph cannot be reviewed later, which is the point of writing it down.
This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.