TutorialsJuly 9, 20263 min read

How to monitor server resources on Linux

Know what your VPS is doing. Learn the essential commands for CPU, memory, disk and network, plus lightweight tools to watch usage over time.

NBy Nxeon

You can't fix what you can't see. Knowing how to check your VPS's CPU, memory, disk and network use lets you catch problems before they become outages and decide when it's time to resize. Here are the tools worth knowing, from quick checks to continuous monitoring.

The quick overview: uptime and load

Start with load average:

uptime

The three numbers are the 1-, 5- and 15-minute load averages. As a rule of thumb, compare them to your CPU count (nproc): a load consistently above your core count means the CPU is a bottleneck.

Memory: free

Memory is what most servers run short of first:

free -h

Look at the available column, not just free — Linux uses spare RAM for caching, which is healthy. If available memory is chronically near zero and swap is heavily used, you need more RAM.

The all-in-one: htop

htop is an interactive, color-coded view of everything at once — per-core CPU, memory, swap, and a sortable process list:

sudo apt install htop -y
htop

Press F6 to sort by CPU or memory and instantly find what's hogging resources. Press F9 to kill a runaway process. It's the first tool to reach for when something feels slow.

Disk space: df and du

Check overall disk usage:

df -h

If a filesystem is filling up, find the culprit directory:

sudo du -h --max-depth=1 /var | sort -h

A full disk breaks databases and web servers, so watch this — logs and old backups are common offenders.

Disk performance: iostat

To see whether the disk itself is a bottleneck:

sudo apt install sysstat -y
iostat -x 2

High %util and long await times mean I/O pressure. This is exactly where NVMe storage pays off — on Nxeon's NVMe disks these numbers stay low under loads that would saturate slower drives.

Network: what's listening and what's flowing

See which ports are open and which process owns each:

sudo ss -tulpn

Watch live bandwidth with a simple tool:

sudo apt install iftop -y
sudo iftop

Finding the top resource users

Sort processes by memory or CPU on demand:

ps aux --sort=-%mem | head
ps aux --sort=-%cpu | head

Watching a value over time

The watch command reruns anything on an interval — handy for keeping an eye on a metric during a load test:

watch -n 2 free -h

Continuous monitoring

The commands above are point-in-time. For history and alerts, install a lightweight monitoring stack:

  • netdata — a single-command install that gives you a real-time web dashboard of hundreds of metrics.
  • Prometheus + Grafana — the standard for graphed metrics and alerting when you run several servers.

A quick netdata install:

wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh

Then browse to http://YOUR_SERVER_IP:19999 (firewall that port to yourself).

What to actually watch for

  • Memory creeping toward full with rising swap use → add RAM.
  • Load average above your core count for sustained periods → add CPU or optimize.
  • Disk above ~80% full → clean up or grow storage.
  • Unexpected processes or ports → investigate; could be a compromise.

Nxeon's dashboard also surfaces per-VPS CPU, memory and bandwidth graphs, so you get an at-a-glance view without logging in. Combine that with these commands and you'll always know exactly how your server is doing — and exactly when to resize.

#monitoring#linux#performance#htop#vps

Deploy your first server in under a minute

No credit card required to get started. Spin up a VPS, break things, and only pay for what you keep running.