Skip to content
VLASIFY™
TutorialHPC, GPU & Linux

Linux server performance monitoring for compute nodes and workstations

Updated · Scientifically reviewed by Priyank Srivastava, PhD on

Short answer

Start with a one-screen overview (top or htop) to see CPU load, memory and the busiest processes, then check each resource with a dedicated tool: vmstat for CPU, memory and swapping, iostat for disk utilisation and latency, sar for history, ss and ip for network, and nvidia-smi for GPUs. The goal is to identify which resource is saturated (CPU, memory, disk, network or GPU) before changing code or hardware. Install the sysstat package to record history automatically.

Who this is for

Researchers and administrators running simulations on Linux workstations, servers or cluster nodes who need to find what is slowing a job down.

Software

procps (top, vmstat, free) distribution defaultsysstat (iostat, sar, mpstat, pidstat) ≥ 11

Prerequisites

  • Shell access to the machine (or to the compute node running your job, for example with srun --jobid=<id> --pty bash on Slurm clusters that allow it).
  • The sysstat package for iostat, sar, mpstat and pidstat:
# Debian/Ubuntu
sudo apt install sysstat
# RHEL, Rocky, Alma
sudo dnf install sysstat
# Record history every 10 minutes
sudo systemctl enable --now sysstat

Step 1: the overview

uptime          # load averages over 1, 5, 15 minutes
top             # press 1 for per-core view, M to sort by memory
free -h         # memory: look at the "available" column

Compare the load average with the core count from nproc.

Step 2: CPU and memory over time

vmstat 2 10     # 10 samples, 2 seconds apart
mpstat -P ALL 2 5
pidstat -u -r 2 5

In vmstat, watch r (runnable processes), us/sy (user/system CPU), wa (waiting for I/O), and si/so (swap in and out). Non-zero si/so over several samples means the machine is short of memory.

Step 3: disk

iostat -xz 2 5
df -h

High %util with large await (milliseconds per request) means the disk is saturated. On a cluster, slow shared file systems show up as processes in state D in top.

Step 4: network and GPU

ss -s                       # socket summary
ip -s link                  # per-interface counters and errors
sar -n DEV 2 5              # network throughput per interface
nvidia-smi                  # GPU utilisation and memory
nvidia-smi dmon -s um -c 10 # utilisation and memory, 10 samples

Low GPU utilisation during a GPU job usually means the GPU is waiting for data or for the CPU; see GPU performance benchmarking.

Verify

You have found the bottleneck when one resource is consistently saturated while the job runs: CPU near 100% on the cores in use, steady swapping, disk %util near 100%, interface throughput near link speed, or GPU utilisation near 100%. Change one thing, then measure again with the same commands.

Troubleshooting

  • iostat or sar: command not found: install sysstat as above.
  • sar reports no data: the collection service is not enabled, or it has not yet run; wait for the first interval.
  • nvidia-smi fails: the driver is not loaded; see GPU not detected on Linux.
  • Cannot log in to a compute node: many clusters restrict this; use your scheduler’s job-step tools or ask the administrators for per-job metrics.

Assumptions and limitations

  • Commands and flags are for common Linux distributions; output columns can differ slightly between versions.
  • These tools show symptoms at the system level. Finding the cause in your code needs a profiler; see how to optimise HPC simulations.
  • Fleet-wide monitoring (Prometheus, Grafana and similar) is outside the scope of this page.

Frequently asked questions

What does load average mean?+

The average number of processes running or waiting to run (including some waiting on disk I/O) over 1, 5 and 15 minutes. Compare it with the number of CPU cores: a load well above the core count means work is queuing.

Is high memory usage a problem?+

Not by itself. Linux uses free memory as file cache, which it releases on demand. Look at the "available" column of free -h and at swap activity (si and so in vmstat). Sustained swapping is the real problem.

Why is my job slow when CPU usage is low?+

It may be waiting for something else: disk I/O (high wa in vmstat or high %util in iostat), the network or a file system, MPI communication, or a GPU. It may also be running fewer threads than expected.

How do I keep a history of performance?+

Enable the sysstat collection service so that sar records statistics every few minutes. For many servers, a monitoring stack such as Prometheus with node_exporter and Grafana dashboards is common.

References

  1. sysstat utilities (sar, iostat, mpstat, pidstat) · sysstat project
  2. vmstat(8) manual page · Linux man-pages
  3. Gregg, Linux performance analysis in 60,000 milliseconds · Brendan Gregg
  4. nvidia-smi documentation · NVIDIA

Want this set up and verified for you?

We install, configure and validate scientific software on your workstation, cluster or cloud, and train your team to run it.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote