Your Node.js app died overnight because it ate all 4GB of RAM on your $3.99 Hetzner server. Your database is crawling because youâre swapping to disk. You just discovered youâre burning through your 20TB bandwidth faster than expected.
You have no idea what ânormalâ resource usage looks like, so youâre flying blind until something breaks.
Letâs learn how to monitor your VPS resources correctly so that you can first of all see whatâs going wrong and ensure it doesnât happen again.
Essential Monitoring Commands
Check Current Resource Usage
# Quick overview - shows live CPU, memory, disk usagehtop
# Memory usage breakdownfree -h
# Disk space usagedf -h
# CPU usage over time (5 second intervals)iostat 5
# Network bandwidth usageiftop -i eth0
Find Resource Hogs
# Top processes by memory usageps aux --sort=-%mem | head -10
# Top processes by CPU usageps aux --sort=-%cpu | head -10
# Find large files eating disk spacedu -h / | sort -hr | head -20
# Check which process is using bandwidthss -tuln | grep :80 # Check what's listening on port 80
Historical Resource Usage
# System load average (1, 5, 15 minutes)uptime
# Memory usage trendvmstat 1 5 # Shows 5 samples, 1 second apart
# Disk I/O statisticsiostat -x 1 5
# Check bandwidth usage this monthvnstat -m
On a 1 vCPU system, load average above 1.0 means youâre overloaded. On a 4 vCPU system, above 4.0 is trouble.
Setting Up Basic Monitoring
Install Essential Tools
# Install toolssudo apt install htop iotop vnstat -ysudo systemctl enable --now vnstat
Quick Alert Script
# Create /opt/scripts/check-resources.sh#!/bin/bashMEM=$(free | awk '/^Mem:/{printf("%.0f"), $3/$2*100}')DISK=$(df / | awk 'NR==2{gsub(/%/,""); print $5}')LOAD=$(uptime | awk -F'load average:' '{print $2}' | cut -d',' -f1 | tr -d ' ')
[ $MEM -gt 80 ] && echo "ALERT: Memory ${MEM}%" && ps aux --sort=-%mem | head -3[ $DISK -gt 85 ] && echo "ALERT: Disk ${DISK}%" && du -sh /var/log[ $(echo "$LOAD > 1.5" | bc) -eq 1 ] && echo "ALERT: Load $LOAD" && ps aux --sort=-%cpu | head -3
sudo chmod +x /opt/scripts/check-resources.sh
# Run every 10 minutesecho "*/10 * * * * /opt/scripts/check-resources.sh" | sudo crontab -
Simple Resource Dashboard
# Create a quick status commandecho 'alias status="echo \"=== SYSTEM STATUS ===\"; uptime; echo; free -h; echo; df -h /; echo; ps aux --sort=-%mem | head -5"' >> ~/.bashrc
source ~/.bashrc
# Run it anytimestatus
Warning Signs Before Things Break
Memory Problems
# Swap usage indicates RAM pressurefree -h | grep Swap
# Out of Memory Killer logsdmesg | grep -i "killed process"# If you see this, processes are being killed due to low memory
CPU Issues
# Load average consistently above number of vCPUsuptime
# High CPU wait (wa) indicates I/O bottleneckiostat 1 1# If %wa is consistently above 20%, you have disk I/O problems
Disk Problems
# Less than 10% free space = trouble incomingdf -h /
# High disk I/O wait timesiostat -x 1 5# If await > 100ms consistently, your disk is struggling
Network Issues
# Bandwidth usage this monthvnstat -m# If you're approaching your monthly limit
# Check for DDoS or unusual traffic patternsss -tuln | wc -l # Count active connectionsnetstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
Secure Your Digital Legacy Forever

A secure digital lockbox with a dead man's switch. When you pass away, your loved ones don't get even ONE EXTRA second to access your bank accounts, investments, or precious memories. Eternal Vault ensures your digital legacy doesn't disappear with you.
When to Upgrade vs Optimize
Quick Optimizations
Memory issues on 4GB:
- Add 2GB swap:
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
- Disable snapd:
sudo systemctl disable snapd.service
(saves 50-100MB)
Upgrade when:
- Swap usage constant
- Load consistently > 2.0 on 2 vCPU
- Memory constantly > 80%
CAX11 ($3.99) â CAX21 ($6.99): Double everything (4 vCPU, 8GB RAM, 80GB storage)
What Could Go Wrong
Canât SSH due to high load: Use your providerâs console and sudo reboot
Emergency cleanup:
# Free disk spacesudo apt autoremove -y && sudo journalctl --vacuum-time=7d
# Kill runaway processessudo pkill -f process-name
Reality Check
20 minutes setup saves hours of debugging at night. CAX11 ($3.99) handles a lot with 4GB RAM and ARM efficiency. Upgrade to CAX21 when you consistently hit 80% on any resource.