Skip to content
HOSTIGAN
Server administration

How to monitor CPU, RAM, disk and network on your VPS

Read load average, available memory, disk space, I/O wait and network traffic on a Linux VPS, set up a simple disk alarm, and decide whether to optimise or upgrade.

Intermediate 6 min read Updated November 24, 2026

Most performance problems on a server do not appear out of nowhere. Memory use creeps up, the disk fills a little more each night, a cron job grows heavier as the database grows. If you know where to look, you see the trend long before visitors notice anything.

This guide shows you how to read the four resources that matter on a Linux VPS: CPU, memory, disk and network. You will learn which numbers mean trouble and which only look alarming, how to set up a simple disk alarm, and how to tell whether you should optimise something or move to a bigger plan.

Start with the overview, then zoom in

Many VPS platforms show usage graphs in the client area or control panel. Graphs are good for one thing: finding when a problem started. Tools on the server are good for finding why. Use them together:

  1. Look at the graph and note the time the spike or trend began.
  2. Log in over SSH and check the resource that spiked.
  3. Read the logs around that time.

Install a few extra tools first. They are small and all come from Ubuntu's repositories:

sudo apt install htop sysstat iotop ncdu vnstat

CPU: load average and what the CPU waits for

nproc       # number of vCPUs
uptime      # load average for 1, 5 and 15 minutes
htop        # live view; F6 to sort, q to quit

Load average is the number of processes running or waiting to run, averaged over 1, 5 and 15 minutes. Read it against nproc: a load of 3.0 on 4 vCPUs leaves headroom, while 6.0 on the same server means work is queuing. The 15-minute value tells you more than the 1-minute value, which jumps around.

The CPU line in top breaks usage down further:

FieldMeaningWorry when
usUser programs (PHP, Node.js, databases)Constantly high: an application is busy
syThe kernelUnusually high: many small I/O or network operations
idIdleClose to 0 for long periods
waWaiting for diskRegularly above a few percent
stSteal: time the hypervisor gave to other guestsPersistently noticeable

In top, press 1 to see every vCPU separately. If one process sits at 100% of a single core while the others idle, the application is single-threaded and more vCPUs will not help; a faster CPU or better code will. The difference between cores and memory is explained in RAM vs. vCPU.

Tip: If you see persistent steal, collect evidence with vmstat 5 12 (one minute of samples) and send it to your provider's support. Numbers get a faster answer than "the server feels slow".

Memory: look at "available"

free -h
vmstat 1 5

The column that matters in free -h is available. Linux uses unused memory as a file cache, so used and free make a healthy server look almost full. That cache is released as soon as a program needs it.

Real memory pressure shows up as:

  • available staying below roughly 10–15% of total.
  • The si and so columns in vmstat regularly above zero, meaning memory is being swapped in and out.
  • Processes killed by the out-of-memory killer:
journalctl -k | grep -i "out of memory"

When MySQL or PHP-FPM disappears without an obvious reason, the OOM killer is a prime suspect.

Disk: space, inodes and load

Running out of space is one of the most common reasons databases and web servers stop. Check it regularly:

df -h          # free space per file system
df -i          # free inodes (many tiny files can exhaust them)
sudo du -xh / --max-depth=1 | sort -h   # largest top-level directories
sudo ncdu /    # interactive browser for disk usage

The usual suspects are logs, the systemd journal, old backups and database dumps left on the server, Docker images and build cache, and application caches. Cap the journal with sudo journalctl --vacuum-size=500M, and see the Docker guide for cleaning up images and rotating container logs. Aim to keep at least 20% of the disk free.

Disk load is a different question from disk space:

iostat -x 5     # r_await/w_await: wait times in ms; aqu-sz: queue size
sudo iotop -o   # which processes are reading and writing right now

On NVMe storage %util is not a reliable measure of saturation, because the drive handles many requests in parallel. Watch wait times and queue size instead.

Note: Heavy disk activity is often a memory problem in disguise. When RAM runs short, the cache shrinks and the server reads the same data from disk again and again. Check free -h before blaming the storage.

Network: traffic and connections

ip a            # find the interface name; it is not always eth0
vnstat          # traffic per day and month (collects data from install onwards)
vnstat -l       # live traffic
sudo ss -s      # summary of open connections
sudo ss -tunap  # every connection with its process

Count connections per remote address to spot a single source hammering the server:

sudo ss -tn state established | awk 'NR>1 {print $4}' | sed 's/:[0-9]*$//' | sort | uniq -c | sort -rn | head

Hundreds of connections from one address usually mean a bot, a scraper or a login attempt. Block it in the firewall, and if a page is being hit hard, add rate limiting in the web server.

Match the numbers to the logs

Once you know when something happened, read the logs from that window:

journalctl --since "2026-11-24 02:00" --until "2026-11-24 02:30"
journalctl -p warning --since today
journalctl --disk-usage

Spikes at the same time every night are almost always scheduled jobs. Check crontab -l, /etc/cron.d/ and systemctl list-timers.

Set up a simple disk alarm

You do not need a full monitoring system to get an early warning. This script logs a warning when the root file system passes a threshold:

sudo nano /usr/local/bin/diskalarm.sh
#!/bin/bash
THRESHOLD=85
USAGE=$(df --output=pcent / | tail -1 | tr -dc '0-9')
if [ "$USAGE" -ge "$THRESHOLD" ]; then
  logger -t diskalarm "Root file system is ${USAGE}% full (threshold ${THRESHOLD}%)"
fi

Make it executable, test it with a low threshold, and schedule it every 30 minutes:

sudo chmod +x /usr/local/bin/diskalarm.sh
sudo /usr/local/bin/diskalarm.sh && journalctl -t diskalarm -n 5
echo "*/30 * * * * root /usr/local/bin/diskalarm.sh" | sudo tee /etc/cron.d/diskalarm

Extend the if block to send an email or call a chat webhook. For more, tools such as Netdata (live graphs on the server) and Uptime Kuma (uptime checks, best run on a different machine) are popular choices.

Warning: Never leave a monitoring dashboard open to the whole internet. Bind it to localhost and use an SSH tunnel, for example ssh -L 19999:127.0.0.1:19999 deploy@YOUR_SERVER_IP, or allow only your own IP.

Optimise or upgrade?

A rule of thumb: if one process or one error explains the load, fix that first. If the load is legitimate, spread across many requests and growing, it is time for more resources.

SymptomTry firstUpgrade when
High CPUCaching, slow queries, runaway cron jobsLoad stays above the vCPU count after tuning
Low available RAMFewer PHP-FPM workers, smaller database buffersavailable stays low and swap is active
Disk filling upRotate logs, remove old backups and imagesReal data keeps growing
High disk waitAdd RAM for cache, fix heavy queriesWait times stay high under normal load
High network trafficCache static files, block abusive botsLegitimate traffic keeps rising

How to choose the right VPS helps you size the next step. Take a backup before you resize, and plan for a restart.

Common misunderstandings

  • "The server uses all its RAM." It is cache. Check available.
  • High load but idle CPU. Processes are waiting on disk or network storage, which counts towards load.
  • The disk is full but du finds nothing. A deleted file is still held open by a process. Find it with sudo lsof +L1 and restart that process.
  • The same spike every night. A backup, cron job or systemd timer.

In short

Use graphs to see when a problem began and server tools to see why. Compare load average with nproc, judge memory by available, keep 20% of the disk free and watch wait times rather than %util on NVMe. Set up at least a disk alarm, and fix the cause before you buy more capacity. New to the terminal? The essential Linux commands cover the basics.

Room to grow on Hostigan

A Hostigan VPS runs on AMD EPYC and Intel Xeon hosts with ECC memory and Ceph storage on NVMe, with full root access so you can install every tool in this guide. When your measurements show you have outgrown a VPS, a dedicated server gives you a whole machine to yourself.

Frequently asked questions

Linux uses spare memory as a file cache to speed up disk access and frees it the moment programs need it. Look at the available column in free -h, not the used or free columns.