Skip to content

Set idle thresholds from measured idle instances so --idle-timeout can fire (#1093) - #1098

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1093
Oct 17, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1093

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1093. Both idle thresholds were 100 KB per one-minute tick. Real untouched instances on every supported Linux AMI exceed that on their own, so idle-stop never fired (measured live: four instances, 20+ minutes each, every tick "Not idle").

untouched, per minute AL2023 arm64 AL2023 x86_64 Ubuntu 24.04
disk I/O 1.3–7.8 MB 1.3–3.9 MB 0.14–3.7 MB
network ≤ ~186 KB ≤ ~148 KB 21–55 KB

Disk is almost all systemd-journald (per-process /proc//io over 5 minutes: journald 11 MB, everything else < 0.4 MB).

  • idleNetworkBytesThreshold = 1 MiB/min (~5× the highest idle reading), idleDiskBytesThreshold = 16 MiB/min (~2× the highest idle spike, 4–16× typical). A minute over a threshold only restarts the idle window, so the margin is over the steady background, not every spike.
  • The assume-active placeholders are now 64× the thresholds (they were 1 MB, which would have been under the new thresholds).
  • Tests: TestMeasuredIdleMinutesReadIdle drives the real idleDecision with the measured minutes; TestWorkloadMinutesReadActive with job-scale I/O. Watched failing against compiling reverts both ways (old 100 KB thresholds; thresholds at 1 TiB). Removed four tests that compared values against their own local copy of "100000" and so could never fail: they are why the wrong threshold went unnoticed. The Prometheus scrape calls IsIdle()/getCPUUsage() and shares sample state with the monitor loop: data race, and a scrape shrinks the idle window (false idle-stop possible) #952 scrape test now scales with the threshold.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--idle-timeout never fires on an untouched default instance: system background I/O is 10-40x the 100 KB/min disk threshold

1 participant