Add fast path for net_io_counters on Windows to reduce idle CPU usage (#9161)#9305
Open
kishansaaai wants to merge 4 commits into
Open
Add fast path for net_io_counters on Windows to reduce idle CPU usage (#9161)#9305kishansaaai wants to merge 4 commits into
kishansaaai wants to merge 4 commits into
Conversation
Contributor
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 40 files ± 0 40 suites ±0 14h 29m 4s ⏱️ - 13m 58s For more details on these failures and errors, see this check. Results for commit 8bd071e. ± Comparison against base commit 3b0ba32. ♻️ This comment has been updated with latest results. |
efe7e83 to
2ad91d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses high idle CPU usage on Windows (#9161) caused by the frequency and overhead of psutil.net_io_counters() inside Dask's system monitoring code.
Root Cause
On Windows, \psutil.net_io_counters()\ queries all adapter properties (DNS, IP addresses, multicast, unicast details, friendly names, etc.) and performs a double call to \GetAdaptersAddresses\ to determine buffer sizes. This compounds across workers, leading to high idle CPU load.
Fix
This PR introduces a Windows-only fast path utilizing \ctypes\ to invoke \GetAdaptersAddresses\ and \GetIfEntry2\ directly.
Benchmarks (Windows)
Closes #9161