Monitoring CPU, memory, disk, and network usage helps you catch performance issues before they affect your users. Here are the essential tools for VPS resource monitoring.
htop β Real-Time Process Viewer
Install and run htop for an interactive view of CPU, memory, and running processes:
apt install htop -y\nhtopPress F6 to sort by CPU or memory. Press F9 to kill a process. Press q to quit.
Disk Usage
# Show disk usage by partition\ndf -h\n\n# Show disk usage of a directory\ndu -sh /var/www/*\n\n# Find largest files in /var\nfind /var -size +100M -type f Network Connections
# Show active network connections\nss -tulpn\n\n# Check bandwidth usage\napt install vnstat -y\nvnstat -h # hourly stats\nvnstat -d # daily stats Uptime and Load Average
uptime\n# Output: 14:22:01 up 30 days, 2:14, 1 user, load average: 0.12, 0.15, 0.10Load average shows system load over 1, 5, and 15 minutes. Values below your CPU count are healthy. Values consistently above indicate the server is overloaded.