improve efficiency of reporting.iostat.DiskStats

Description

PR: https://github.com/truenas/middleware/pull/10173

Investigating scalability problems on a large internal system showed that an abnormal amount of time was spent in `psutil.disk_io_counters`. Specifically, it was busy doing `readlines()` on `/proc/diskstats`. This fixes that problem by transposing the same logic to this class but instead of reading the entire file into memory, iterate over it. Generating flamegraph afterwards has shown that this is no longer a problem.

Problem/Justification

None

Impact

None

Activity

Show:

Bug Clerk December 8, 2022 at 3:07 PM

Automation for Jira December 8, 2022 at 3:07 PM

This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.

Complete

Details

Assignee

Reporter

Labels

Original estimate

Time remaining

0m

Components

Priority

Katalon Platform

Created December 2, 2022 at 3:45 PM
Updated February 27, 2025 at 10:09 PM
Resolved December 8, 2022 at 3:08 PM