Skip to content

Send the pressure (PSI) of the CPU, the memory and the disk #42

Description

@nabil1440

Blocker: no. This can wait until the agent stack is merged. It goes on top of the 10-second readings in the same stack.

Part of contract v0.4.0, section "2026-09-24 — Peaks, pressure and disk activity": "Pressure (PSI)".

Defect

  • The agent sends how full the memory is. It does not send how long tasks wait for the CPU, the memory or the disk.
  • Memory that makes tasks wait is a problem at any percent.

Cost

  • A server can be slow while each chart looks normal.
  • A later alert on "tasks wait for the disk" has no data.

Benefit of the fix

  • The kernel measures the wait directly: Pressure Stall Information (PSI). The agent sends it for each minute, with the peak of the minute.

Fix

  1. At each reading, read /proc/pressure/cpu, /proc/pressure/memory and /proc/pressure/io.
  2. Use the some line and its total= counter. Do not use avg10 or avg60.
  3. Add the optional fields cpu_pressure_percent, memory_pressure_percent and io_pressure_percent, and a _max_percent peak for each.
  4. Calculate each value as the delta of total divided by the microseconds between the two readings, times 100.
  5. Send null when the kernel has no PSI, when there is no usable previous reading, or when a counter went back.

Completion checks

  • The six fields have a value on a kernel with PSI.
  • The six fields are null without /proc/pressure, and the agent writes one log line.
  • The fields are null in the first sample and after a reboot.
  • Each peak is not less than the value of the minute.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions