Understanding CPU, RAM, and disk usage on your server
Learn to read CPU load, RAM consumption, disk I/O, and swap usage on a Linux VPS. Use top, htop, df, free, and iostat to diagnose performance issues.
On this page
Before you can fix a performance problem, you need to understand what the numbers mean. This guide explains the key resource metrics on a Linux VPS and which commands to use.
CPU load
Run top or htop to see CPU usage. Key columns:
| Column | Meaning |
|---|---|
| %CPU | Percentage of one CPU core used by the process |
| Load average (1m 5m 15m) | Average number of runnable processes. On a 2-core VPS, load of 2.0 = 100% busy. Load of 4.0 = double-overloaded. |
| us (user) | CPU used by user-space processes (PHP, MySQL, etc.) |
| sy (system) | CPU used by the kernel |
| wa (I/O wait) | CPU waiting for disk I/O-high wa% = disk bottleneck |
A load average consistently above your CPU core count indicates the server is overloaded.
RAM and swap
free -m
Output example:
total used free shared buff/cache available
Mem: 1994 890 120 45 984 1059
Swap: 999 12 987
Focus on the available column (not "free")-this is memory actually available for new processes after the OS frees cached memory. If available RAM is consistently near zero, the server needs more RAM or optimization.
Swap use above 100 MB on a 1–2 GB VPS means the server is under memory pressure-processes are paging to disk, causing slowdowns.
Disk space and I/O
# Disk space by mount point
df -h
# Disk I/O stats (install with: apt install sysstat)
iostat -x 1
# Find large directories
du -sh /var/www/* | sort -rh | head -20
In iostat, watch %util-above 80% means the disk is heavily loaded. High disk I/O is often caused by database writes, log files, or a runaway process writing continuously.
Finding the resource hog
Sort processes by CPU or RAM in top: press P to sort by CPU, M to sort by memory. The top process is usually the culprit. Common causes:
- php-fpm-too many PHP processes or a slow WordPress site
- mysqld-slow queries or missing indexes
- python/node-runaway application process
- kswapd-kernel swapping memory to disk (RAM exhaustion)
For MySQL slow queries, enable the slow query log:
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;
Then check /var/log/mysql/mysql-slow.log for queries taking over 1 second.
Running out of resources?
Upgrade to a larger plan or add more resources to your VPS or dedicated server.





















