Effective server monitoring is essential for maintaining a healthy, performant VPS. This guide covers the fundamental tools and techniques for monitoring system resources on your RamNode VPS, helping you identify bottlenecks, troubleshoot issues, and ensure optimal performance.
Prerequisites
- • A RamNode VPS with SSH access
- • Root or sudo privileges
- • Basic familiarity with the Linux command line
CPU Monitoring
Your CPU is the brain of your server. Monitoring CPU usage helps identify processes consuming excessive resources and potential performance bottlenecks.
Using top
The top command provides a real-time, dynamic view of system processes:
topKey metrics to watch in the top header include %us (user CPU), %sy (system CPU), %id (idle), and %wa (I/O wait). Press q to exit.
Using htop
For a more user-friendly interface, install and use htop:
# Install htop
sudo apt install htop # Debian/Ubuntu
sudo yum install htop # CentOS/RHEL
# Run htop
htophtop displays color-coded CPU bars for each core, making it easy to identify load distribution across your VPS's vCPUs.
Quick CPU Load Check
For a quick snapshot of CPU load averages:
uptimeThis displays three load averages representing 1, 5, and 15-minute intervals. As a general rule, load average should stay below the number of CPU cores available.
Memory Monitoring
Memory management is critical for server stability. Running out of memory can cause applications to crash or trigger the OOM killer.
Using free
The free command displays memory usage in a simple format:
free -hThe -h flag displays values in human-readable format (GB, MB).
| Column | Description |
|---|---|
| total | Total installed memory |
| used | Memory currently in use by processes |
| available | Memory available for new applications (includes cache) |
| buff/cache | Memory used for disk caching (reclaimable) |
Finding Memory-Hungry Processes
To identify processes consuming the most memory:
ps aux --sort=-%mem | head -10Disk Usage Monitoring
Monitoring disk space prevents unexpected outages caused by full filesystems, which can crash databases and prevent logging.
Using df
The df command shows filesystem disk space usage:
df -hFocus on the Use% column. As a best practice, keep disk usage below 80% to maintain performance and leave room for unexpected growth.
Using du
To identify which directories are consuming the most space:
# Show largest directories in /var
sudo du -h --max-depth=1 /var | sort -hr | head -10
# Find large files (over 100MB)
sudo find / -type f -size +100M -exec ls -lh {} \; 2>/dev/nullDisk I/O Monitoring
Use iostat to monitor disk I/O performance:
# Install sysstat package first
sudo apt install sysstat # Debian/Ubuntu
# View I/O statistics
iostat -x 1 5Watch the %util column—sustained values above 80% indicate disk I/O bottlenecks.
Network Monitoring
Network monitoring helps identify bandwidth usage patterns, potential security issues, and connectivity problems.
Using vnstat
vnstat provides network traffic statistics over time:
# Install vnstat
sudo apt install vnstat # Debian/Ubuntu
# View traffic summary
vnstat
# View live traffic
vnstat -lUsing iftop
For real-time bandwidth monitoring per connection:
sudo apt install iftop
sudo iftop -i eth0Active Connections
To view current network connections:
# List all connections
ss -tuln
# Count connections by state
ss -sAll-in-One Monitoring with vmstat and sar
Using vmstat
vmstat provides a comprehensive system overview:
# Update every 2 seconds, 10 iterations
vmstat 2 10| Column | Meaning |
|---|---|
| r | Processes waiting for CPU time |
| b | Processes in uninterruptible sleep (usually I/O) |
| swpd | Amount of swap memory used |
| si/so | Swap in/out—high values indicate memory pressure |
| wa | CPU time spent waiting for I/O |
Using sar for Historical Data
The sar utility (part of sysstat) collects and reports historical performance data:
# Enable data collection
sudo systemctl enable sysstat
sudo systemctl start sysstat
# View CPU usage for today
sar -u
# View memory usage
sar -r
# View I/O statistics
sar -dQuick Reference Commands
Here's a summary of essential monitoring commands for quick reference:
| Command | Purpose |
|---|---|
| top / htop | Real-time process monitoring |
| free -h | Memory usage overview |
| df -h | Disk space usage |
| iostat -x 1 | Disk I/O performance |
| vmstat 1 | Overall system health snapshot |
| vnstat | Network traffic statistics |
| ss -tuln | Active network connections |
| uptime | System uptime and load averages |
Monitoring Best Practices
Automated Monitoring Solutions
While the command-line tools above are great for quick checks and troubleshooting, for production environments you'll want automated monitoring with dashboards, alerting, and historical data. We have detailed deployment guides for several popular monitoring solutions:
Grafana + Prometheus
Industry-standard monitoring stack with beautiful dashboards and powerful alerting.
Netdata
Real-time performance monitoring with beautiful dashboards and zero configuration.
Netdata GuideNext Steps
Now that you understand basic monitoring, consider setting up automated monitoring with alerting. For persistent performance issues or questions about your VPS resources, contact RamNode support for assistance.
