Observation and diagnostics · Intermediate

Investigating historical load with sar

Compare retained activity observations with aligned times and units, recognizing the limits of averages and missing collection.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Read historical load after an incident
  2. Check the archive file and clock
  3. Compare several metrics in the same interval
  4. Missing collection cannot be reconstructed
  5. Ask Logeia about this articleCheck your understanding

Read historical load after an incident

Sar reads system-activity observations collected by sysstat, covering categories such as CPU, memory, I/O and networking. If collection and retention were already enabled, it can reveal what happened during an incident that has ended. A machine that looks healthy now may have experienced a substantial earlier burst or backlog. Installing the tool afterward cannot recover measurements that were never saved. The selected fields and sampling interval therefore determine which historical questions the archive can answer and which require other evidence.

Check the archive file and clock

For example, sar -u -f /var/log/sa/sa27 -s 10:00:00 -e 10:15:00 reads CPU observations from an illustrative saved file for a specified window. Archive location and naming differ across distributions and configurations. Check the complete date, time zone and reboot history before assuming that a file called sa27 contains the intended incident. The path and times here demonstrate syntax; they do not assert that such a file exists in the reader’s environment or that any particular load was measured during that interval.

sh
sar -u -f /var/log/sa/sa27 -s 10:00:00 -e 10:15:00

Compare several metrics in the same interval

Compare CPU changes with memory, I/O waiting and network traffic in the same time range. Application request counts help distinguish higher utilization caused by more legitimate demand from falling throughput under unchanged demand. A high average at 10:05 does not prove that every request in that interval was slow. Short spikes and a small number of extreme delays can disappear inside coarse averages. Conversely, two metrics rising together may share a workload cause rather than one directly causing the other, so preserve the distinction between correlation and a demonstrated execution mechanism.

Missing collection cannot be reconstructed

Check archive retention, enabled fields, sampling frequency, reboots and statistics resets, and never silently turn missing observations into zero activity. Align clocks when comparing hosts. Historical system statistics suggest targets for investigation but rarely establish which process or query caused the problem. Prepare for recurrence with the required application detail or focused process observation. Choose collection and retention settings that balance investigative value against storage and monitoring overhead. A useful archive is one whose timing and semantics are understood, not simply the largest quantity of counters retained without a plan for interpretation.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Understand the systems behind the web · STEP 14

Choose a learning path