How to Monitor CPU and RAM Usage on Linux
Checking CPU usage
`top` and `htop` both show live, per-process CPU usage. For a quick overall number, `uptime` shows load average over the last 1, 5, and 15 minutes. The number to compare it against is your CPU core count: a load average of 4 on a 4-core server means the CPU is fully utilized on average; consistently above that means requests are queuing.
A single short spike usually isn't a problem. A load average that's climbing over days, or that stays elevated well past whatever caused the spike, is worth investigating.
Checking memory usage
`free -h` gives you total, used, free, and cached memory, plus swap. The "used" number alone can be misleading — Linux uses free RAM for disk caching, which is reclaimed instantly when an application needs it. Focus instead on the `available` column, and on swap usage: swap that's climbing steadily (not just briefly used) is the clearer sign of a real memory shortage or a leak.
What "normal" looks like
There's no universal healthy number — it depends entirely on the workload. This is exactly why history matters more than a single reading: knowing that load average normally sits around 1.2 on this server makes a sudden jump to 6 meaningful, in a way a bare "load average: 6" reading in isolation is not.
Setting useful alert thresholds
A common, reasonable starting point:
• **CPU/load:** alert when load average (5-min) exceeds your core count for more than 5–10 consecutive minutes.
• **Memory:** alert when available memory drops below 10–15%, and separately when swap usage starts climbing steadily rather than sitting flat.
Thresholds that are too sensitive train people to ignore alerts; thresholds that are too loose let real problems through. Expect to adjust them after the first few weeks of real data.
CloudStats tracks CPU, load average, memory, and swap continuously as part of [Linux server monitoring](/features/linux-server-monitoring), with configurable thresholds so alerts match your server's actual normal, not a generic default.