Monitoring your server's resources helps you catch performance issues early, plan for scaling, and spot unusual activity. This guide covers built-in tools and how to set up ongoing monitoring.
Quick Real-Time Monitoring
htop - Interactive Process Viewer
apt install htop -y
htop
What you see:
- CPU bars at the top (one per core)
- RAM and swap usage
- List of all running processes sorted by resource usage
- Press
F6to sort by CPU or memory,qto quit
top - Built-in Alternative
top
Similar to htop, but less visual. Press q to quit.
CPU Monitoring
Current CPU Usage
# Average CPU load over 1, 5, and 15 minutes
uptime
# Detailed per-core stats
mpstat -P ALL 1
Install if needed: apt install sysstat -y
Historical CPU Data
sar -u 1 10 # CPU usage every 1 second, 10 times
What "Load Average" Means
load average: 0.52, 0.67, 0.71
- Three numbers = last 1 min, 5 min, 15 min
- A value of
1.0on a single-core server = 100% utilised - On a 4-core server, load average of
4.0= 100% - Rule of thumb: load average should stay below your number of CPU cores
RAM Monitoring
Current Memory Usage
free -h
Example output:
total used free shared buff/cache available
Mem: 3.8Gi 1.2Gi 0.9Gi 85Mi 1.6Gi 2.3Gi
- available = how much RAM processes can actually use (more useful than "free")
- buff/cache = Linux uses spare RAM for caching - this is normal and healthy
Top Memory Consumers
ps aux --sort=-%mem | head -15
Disk Monitoring
Disk Space Usage
df -h
Shows usage per partition. Pay attention to the partition where your
data lives (usually /).
Directory-Level Usage
du -sh /var/www/* # How much space each website uses
du -sh /var/log/* # Log files (often unexpectedly large)
du -sh /* # Top-level breakdown
Find Large Files
find / -type f -size +100M 2>/dev/null | sort -rh | head -20
Disk I/O
iostat -x 1 5
Shows read/write activity per disk. High %util means the disk is a
bottleneck.
Network Monitoring
Current Bandwidth Usage
apt install nload -y
nload
Or use iftop:
apt install iftop -y
iftop
Total Data Transfer
vnstat
Install: apt install vnstat -y - shows daily/monthly traffic
summaries.
Set Up Ongoing Monitoring with Netdata
Netdata provides beautiful real-time dashboards accessible from your browser:
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
Access at: http://YOUR_SERVER_IP:19999
It monitors CPU, RAM, disk, network, applications, and more - all in real time with no configuration needed.
Set Up Alerts with Uptime Monitoring
External monitoring pings your server and alerts you when it goes down:
- UptimeRobot - free, checks every 5 minutes
- Freshping - free tier available
Monitoring Checklist
- ✅
htopinstalled for quick real-time checks - ✅
df -hchecked regularly to avoid full disks - ✅ Log files reviewed or rotated to prevent them filling disk
- ✅ External uptime monitoring configured
- ✅ Load average understood relative to server CPU count
Questions? Email us at [email protected] - we reply in under 2 hours, 7 days a week.