Skip to content

Idle disk I/O check is cumulative-since-boot and its device filter drops every NVMe disk: always 0 on Nitro, always 'active' on xvd/sd/vd #937

Closed

Description

@scttfrdmn

Found while fixing #919 (PR #936). I verified this by reading the code and by running the device filter, copied verbatim, against a list of device names. I did not observe it on an instance.

1. It is not a delta. isIdle compares getDiskIO() with 100000 ("100KB/min threshold"). getDiskIO() returns sysReadDiskIOBytes() directly, which is the cumulative since-boot total of sectors read and written from /proc/diskstats (times 512). There is no previous sample, unlike CPU and network. On Windows, Win32_PerfRawData_PerfDisk_PhysicalDisk.DiskBytesPersec is likewise a raw cumulative counter.

2. The whole-disk filter drops all NVMe devices. Partitions are skipped with "name longer than 4 and ending in a digit". The filter output:

nvme0n1 false     <- the root disk on every Nitro instance
nvme0n1p1 false
nvme1n1 false
xvda true
xvda1 false
sda true
sda1 true         <- partition counted (len 4), double-counting sda
vda true
vda1 true         <- same

Effect:

Suggested fix: make it a delta, with a first-sample bool and a measured flag, the same way networkBytes/cpuUsage work. Pick whole disks by structure (/sys/block/* lists whole disks only, and partitions sit under them) instead of by name prefix and length. Add fixtures for nvme0n1+p1, xvda+xvda1, and sda+sda1.

Metadata

Metadata

Assignees

No one assigned

    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