LAB-PROC-02 - Live Monitoring: top and htop
Live Monitoring: top and htop
Use live process monitors to see changing CPU and memory activity without confusing a live view with a one-time snapshot.
- Use top to observe live process changes.
- Explain the difference between a live monitor and a static snapshot.
- If you create a practice CPU load, clean it up before leaving the lab.
Part A: The Field Guide
ps gives you a snapshot. top gives you a live view.
That difference matters because process activity changes second by second.
Useful Distinction
If you need “what is happening right now,” start with a live tool. If you need a precise one-time listing, a snapshot tool may be enough.
Part B: The Drill Deck
Terminal required: this lab is observational first.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: Open top and read the screen
- Run
top - Identify the load average area
- Identify the CPU summary area
- Identify the process list below
- Quit with
q
Exercise G2: Reopen and watch changes
- Run
topagain - Watch the list update for several seconds
- Notice that the most active processes can move up and down over time
- Quit with
q
Exercise G3: Optional htop pass
If htop is installed:
- run
htop - compare how it presents CPU, memory, and process lists
- quit with
qorF10
S Solo Task described, hints available - figure it out >
Exercise S1: Create one safe short-lived load
In one terminal:
- run
yes > /dev/null & - note the job or PID
- open
top - find the load you just created
- exit
top - stop the
yesprocess withkill <PID>
This is enough to prove that top reflects live changes.
Exercise S2: Explain load average carefully
Without going deep into theory, explain why a high load average means more only when you interpret it alongside the number of CPU cores and the rest of the screen.
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: Compare snapshot versus live view
Create one short practice load, then compare:
- what
ps aux | grep yestells you - what
toptells you
Explain which tool is better for a frozen moment and which tool is better for a changing workload.