Knowledge Base

Systematic Linux performance diagnosis

Author: DEWOLF.IT

Identify CPU, memory and I/O pressure with vmstat, iostat, sar and a time-aligned baseline.

This English edition covers the main steps. See the Dutch article for the full detail and examples.

Define the slow operation

Record the operation, host, time window and expected latency. Establish whether the issue affects one process, one node or the whole service. Correlate a repeatable symptom with host and application signals.

uptime
vmstat 1
iostat -xz 1
pidstat -dur 1

CPU, memory and I/O

  • Consider the CPU run queue alongside utilisation, effective CPU capacity and the processes actually using it.
  • Look at available memory, swap activity and memory pressure over time. Reclaimable cache is a normal use of memory.
  • Correlate device latency and queues with the mount, storage stack and process doing the I/O. A host-average metric can hide a single busy device.

Use recorded history

If sysstat recorded the incident, align the CPU, memory and disk samples with the application timeline. Compare with an equivalent healthy window before changing anything.

sar -u -f /var/log/sa/saDD
sar -r -f /var/log/sa/saDD
sar -d -f /var/log/sa/saDD

Validate any change against the same workload and the user-visible latency.