Monitoring System Load and Investigating Its Causes
Overview
A simple set of notes intended as an explanation for new graduates.
| -Item- | -Explain- |
|---|---|
| %user | CPU usage in user space |
| %system | CPU usage in kernel space |
| %iowait | Percentage of time spent waiting for I/O |
| %idle | Percentage of time the CPU is idle and not waiting for I/O |
(1) %iowait is exceptionally high
- %iowait high
- %user low
- %system low
Cause
Heavy swapping may be occurring.
Investigation steps
1. Check SwapIn & SwapOut
1 | $ sar -W |
2. System-wide memory usage
1 | $ free |
3. Sort by memory usage and identify the processes consuming memory
1 | $ top |
- Shift+p: sort by CPU usage
- Shift+m: sort by memory usage
The actual cause
Since it occurred periodically at the same time, I checked the cron configuration with crontab -l and found a batch job running that nobody knew about. sweat
(2) %user is exceptionally high
- %iowait low
- %user high
- %system low
Cause
CPU usage is high.
Investigation steps
1. Sort by CPU usage in descending order to identify the process
1 | $ top |
- Shift+p: sort by CPU usage
This is only a small part, but I hope it helps.
That’s all.
