Skip to content

diskIostat: grouped iostat averages swap/cache/member disks into diskServiceTime, masking a saturated data volume #965

Description

@MagnaCapax

Problem

scripts/lib/diskIostat.php measures disk latency over every block device matching PMSS_BLOCK_DATA_DEVICE_NAME_PATTERN (sd*|vd*|xvd*|nvme*|mmcblk*, scripts/lib/runtime.php). It runs one grouped sample:

iostat -xm 120 2 -g grp1 <all matching devices>

It then reports the grp1 row: diskAwait = group r_await, diskServiceTime = group w_await.

The group row is a request-weighted average across all of those devices. A busy, fast device that is not the data volume therefore drowns out a saturated data volume:

  • Guest with a swap disk (e.g. vda = data, vdb = swap). In one sample, swap ran ~3000 r/s + ~2800 w/s at 0.3–2.3 ms, while the data disk was at 100% util, r_await 83 ms / w_await 171 ms. The group w_await from the same sample works out to ~2.9 ms. The reported service time looked healthy while the volume holding user data was saturated.
  • Bare metal. The pattern takes each RAID member disk and any cache NVMe, but not the md device the data actually lives on. The average therefore blends member disks and cache devices rather than describing the data volume.

Downstream consumers treat diskServiceTime as the data-volume latency, so a saturated node can look nominal.

Candidate fixes (choose one)

  1. Exclude swap devices (from /proc/swaps) and cache-only devices from the grouped sample.
  2. Sample the device(s) that back the data mount (/home) and report those, falling back to the group.
  3. Report the per-device max of r_await/w_await alongside the group value (new fields), so consumers can use the worst device.

Option 2 matches what the metric is used for. Option 3 is the smallest change that keeps existing fields as they are.

Notes

(An average is a very polite way to hide the worst disk.)


Tier-3 declared at filing: --why multiple-fix-paths — GH#631 tier gate. Declared fix size: 30 lines vs 29-line body — size gate (operator directive 2026-07-29). Owner: scripts/lib/diskIostat.php in MagnaCapax/PMSS — owner gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomplete-verifyImplemented/closed; awaiting operator verification on real host

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions