node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Performance regression in diskstats collector

Open wjordan opened this issue 7 months ago • 1 comments

#3022 adds the rotational label to the info metric for devices through an extra call to SysBlockDeviceQueueStats, which reads a large number of of queue sysfs files and causes a significant performance regression in the diskstats collector.

On a system with a large number (thousands) of block devices, the diskstats collector now takes ~10x longer to scrape (~400ms -> ~4s) in version 1.9 because of this change.

Given the added overhead of this new collection, I think the new rotational label should be removed, or controlled by a config flag, so that it can be selectively enabled/disabled when not needed.

Or an alternative implementation that just reads+parses the rotational file directly (and not all other ones in the /queue sysfs directory) could have much less of a performance impact.

wjordan avatar Mar 26 '25 20:03 wjordan