Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Using iostat and vmstat for Disk and Memory Performance Analysis

Linux performance analysis becomes clearer when disk latency and memory movement are read together. iostat shows per-device throughput, queues and request latency, while vmstat samples system-wide CPU, runnable processes, swap activity and blocked tasks. On RHEL, CentOS and Fedora, their combination turns a vague slow-server report into measurable evidence. Learn more about Troubleshooting Network Connectivity With Ping And Traceroute.

This guide uses interval sampling instead of since-boot averages, then connects those figures with process, filesystem and network clues. The method works for Australian VPS instances, dedicated servers and on-premises systems, although peak workload timing and regional connectivity can change the final interpretation.

Establishing a reliable baseline

Install the utilities if needed with sudo dnf install sysstat procps-ng, then record a baseline during representative load: iostat -xz 1 10 and vmstat 1 10. Ten samples reduce the chance of reacting to one unusually busy interval. Discard the first vmstat report because it reflects activity since boot rather than the selected interval.

Note the timestamp, workload, CPU model, storage type and virtualisation layer. lsblk, df -h, free -h and uptime provide useful context, while iostat -x distinguishes partitions, device-mapper volumes, RAID arrays and physical disks. Always compare the same device and workload across runs.

Reading iostat disk metrics

Read r/s and w/s as completed reads and writes, rkB/s and wkB/s as throughput, and await as average request latency. aqu-sz describes the average queue observed by the device. A high await with sustained throughput points to slow service; a short burst may simply reflect queued work arriving together.

Do not treat %util as a universal saturation score. It measures time during which at least one request was in flight, so parallel NVMe devices can remain responsive despite a high value. Compare latency, queue depth and throughput together, then repeat with iostat -xz 1 while the affected workload runs.

Understanding vmstat memory pressure

In vmstat, inspect r and b, then the memory columns free, buff/cache and available. Persistent si and so values show pages being swapped in and out, while wa indicates CPU time lost while tasks wait for I/O. Repeated si/so with falling available and rising wa suggests pressure or thrashing.

Linux routinely uses otherwise idle RAM for cache, so high used memory alone is not a diagnosis. Compare free -h over time and check whether cache can be reclaimed. Android teams investigating client symptoms can use Android memory leaks as a separate diagnostic path, rather than treating server swap counters as equivalent to mobile heap retention.

Relating CPU, queue, and I/O data

Relate disk activity to CPU scheduling. A run queue (r) larger than the available CPU count indicates scheduler contention; a growing b count alongside high disk await points to uninterruptible I/O waits. High wa with healthy disk latency may instead reveal virtualisation overhead, storage contention or another blocked resource. Check st for CPU stolen by the hypervisor.

Use pidstat -d 1 10 to find processes issuing heavy I/O, and top or htop to compare CPU and memory use. Mixed symptoms need mixed evidence: a database may be CPU-bound while log writes make the disk look busy. Isolate the process, operation and time interval before assigning a bottleneck.

Following evidence with safe checks

Follow measurements with low-risk checks: inspect dmesg and journalctl -k for I/O or filesystem errors, review SMART data with smartctl -a, and verify free space and mount options with df -h and findmnt. For RAID or LVM, also inspect controller and layer metrics because the mapper device can conceal slower underlying media.

Do not create artificial load with dd, fio or cache-dropping commands on a production host; those tests can trigger timeouts and destroy the state being investigated. Short, labelled observation runs are more useful. If queueing persists, compare service-time history with sar -d -p and sar -r, then capture the output for later correlation.

Adding Australian operating context

Australian conditions add useful context. Workloads in Sydney, Melbourne, Brisbane and Perth often use Australian VPS or dedicated-server capacity from local suppliers, or Australian regions operated by global cloud platforms. Data-residency requirements frequently influence the selected location. Batch jobs scheduled during Australian business hours can also overlap with international peaks, so timestamps should use AEST or AEDT rather than an unlabelled UTC assumption.

Branch offices on Australian NBN Ethernet, FTTP or fixed-wireless connections may have different latency from datacentre Ethernet. If disk figures are normal but application requests wait, network path checks can separate packet loss and routing problems from server-side I/O delay. International routes through the Southern Cross network also make overseas services behave differently from local ones.

Classifying bottleneck patterns

Classify the result before choosing a response. Sustained high await, queue growth, blocked tasks and nonzero wa identify a storage service problem. A full run queue with modest disk latency points to CPU saturation. Falling available memory plus sustained swap traffic identifies memory pressure. None of these patterns should be inferred from a single command sample.

Repeat the same measurements after one change at a time, and keep workload volume comparable. Pair iostat with vmstat, pidstat, sar, filesystem logs and capacity data. If results vary widely, record several intervals and identify when the slowdown begins; averages can hide short but damaging stalls.

The durable rule is to treat iostat as device-level evidence, vmstat as system-level context, and every metric as conditional on workload, hardware and sampling interval. A single percentage, throughput figure or memory total tells only part of the story.

What should remain is a defensible sequence of observations: establish the baseline, identify the constrained resource, verify the pattern with a second tool, and preserve evidence across time. That sequence turns performance symptoms into a diagnosis rather than a guess.