Create contention on purpose and watch steal time appear
Task
Oversubscribe your own host deliberately, then read the metric that reveals contention from inside a guest. The point is to see steal time move, because a number you have watched respond to a cause you created is a number you will recognise on a production system.
Steps
- Give each guest as many vCPUs as your host has physical cores, so the two guests together are oversubscribed by roughly 2:1. Record the host core count and each guest's vCPU count in
lab/contend.txt. - With only the first guest running, capture an idle baseline: run
vmstat 1 10and record thestcolumn and theidcolumn. - Start the second guest and run a CPU-saturating workload on it -- a few processes running
openssl speedor an equivalent busy loop. - Back in the first guest, run
vmstat 1 30again and record thestcolumn. Compare the two captures inlab/contend.txt. - Write one sentence on why the first guest's own CPU utilisation does not explain its slowdown, and one on what you would do about this if it happened on a rented instance.
Verify
grep -Ec 'st|steal' lab/contend.txt
awk '/baseline/,0' lab/contend.txt | grep -Eco '[0-9]+'
grep -Eci 'relocat|stop and start|larger instance|dedicated' lab/contend.txt
The last check is the remedy: recognising steal time is only useful if you know that moving the instance is the first thing to try.
This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.