How to Check CPU, RAM & Disk Usage on a Linux Server
server is slowhigh CPUdisk fullWhen a server feels slow or a game lags, the first job is to see what's using the resources. These commands tell you in seconds whether it's CPU, RAM or disk — and which process is to blame.
CPU & memory in real time: top / htop
top is on every server; htop is the friendlier colour version (install it if you can). Both show a live list of processes sorted by CPU, so you can spot the hog:
top # press 'M' to sort by memory, 'P' by CPU, 'q' to quit
htop # nicer UI; arrow keys + F9 to kill a process
Memory at a glance: free
free -h shows total, used and available RAM in human-readable units:
free -h
# total used free available
# Mem: 7.7Gi 3.1Gi 1.2Gi 4.3Gi
Linux uses spare RAM for cache, so "free" looks low on a healthy server. The "available" column is the real figure — that's how much your apps can still use.
Disk space: df & du
df -h shows how full each disk is. If one is at 100%, that alone can crash services:
df -h # usage per filesystem
du -sh /home/* | sort -h # which folders are biggest
Disk I/O: is the disk the bottleneck?
High %wa (I/O wait) in top means processes are waiting on the disk — a classic cause of lag on slow storage. iostat (from sysstat) shows per-disk activity.
Quick triage order
htop/top— what's using the CPU?free -h— is RAM exhausted (low "available")?df -h— is a disk full?- High
%wain top — is storage the bottleneck?
Slow server? top, free, df — in that order. Ninety seconds tells you whether it's CPU, RAM or disk.
Checking network usage too (nload / iftop / vnstat)
CPU, RAM and disk aren't the only bottlenecks — a saturated network link causes the same lag symptoms. nload and iftop show live bandwidth per connection; vnstat tracks usage over time so you can spot a recurring spike (a backup job, a DDoS, or a player download surge).
Finding what's eating disk space long-term
du -sh is slow on a big tree. ncdu gives an interactive, much faster breakdown of what's filling a disk — logs, old backups and world/save files are the usual suspects on a game server. For a longer-term view of memory and CPU, vmstat 2 prints a fresh snapshot every 2 seconds so you can watch trends instead of one instant.
How to prevent resource exhaustion on a game or web server
- Set up log rotation so logs don't silently fill the disk over weeks.
- Monitor with a lightweight always-on tool (Netdata, Munin) instead of only checking manually when something feels wrong.
- Set per-service memory limits (systemd
MemoryMax) so one runaway process can't take down everything else. - Schedule backups and heavy jobs off-peak so they don't spike CPU/disk I/O during play hours.
- Keep at least 10–15% of each disk free — many services misbehave badly once a disk hits 100%.
Related Linux performance guides
If RAM usage keeps climbing until a process gets killed, see Linux out of memory (OOM killer). If a disk actually fills up, read "No space left on device". To work out whether game lag is CPU or network specifically, see game server lag: CPU or network?, and for more day-to-day commands see our essential Linux commands for game server admins.
NVMe-backed game servers
Slow disks cause lag. Our servers run on fast NVMe with high-clock CPUs — so resources are never the bottleneck.
Frequently asked questions
Why is my "free" memory so low on Linux?
Linux deliberately uses unused RAM as disk cache to speed things up. That memory is instantly reclaimable, so look at the "available" column in free -h, not "free".
How do I find what's using all my CPU?
Run htop (or top and press P). The process at the top of the list is your biggest CPU user. For game servers it's usually the game process itself when full.
What does high I/O wait mean?
A high %wa value means the CPU is idle but waiting for the disk. It points to slow storage or too much disk activity — a common cause of lag that more CPU won't fix. NVMe storage solves most of it.
What tool shows network usage the way top shows CPU?
iftop or nload give a live, per-connection view of bandwidth usage. vnstat is better for tracking usage over hours or days if you need to spot a recurring spike.
How do I check what's filling my disk quickly, without waiting on du?
Install and run ncdu — it gives an interactive, much faster breakdown of disk usage by folder than du -sh on a large filesystem.
What's a safe amount of free disk space to maintain?
Aim to keep at least 10–15% of each disk free. Many Linux services and databases behave unpredictably, not just slowly, once a disk fills to 100%.
Can I get alerted automatically before a server runs out of resources?
Yes — a lightweight monitoring tool like Netdata or Munin can alert you by email/webhook on high CPU, low memory or low disk space, instead of you having to check manually.
Related articles
Fix SSH "Connection refused" / "Connection timed out"
SSH "connection refused" vs "timed out" — what each means and the exact steps to fix them.
Read fix Linux & VPSFix "Permission denied" on Linux (chmod & chown Explained)
"Permission denied" on a script or file? Understand chmod/chown and fix it the right way.
Read fix Linux & VPSEssential Linux Commands for Game Server Admins
A practical Linux cheat sheet for running a game server on a VPS — files, processes, screen, services and logs.
Read fix