bypass ingress throttle in drain mode - #3134
Merged
Merged
Conversation
Contributor
🚀 Performance Benchmark Report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3134 +/- ##
=====================================
+ Coverage 90% 90% +1%
=====================================
Files 441 441
Lines 38743 38773 +30
=====================================
+ Hits 34663 34693 +30
Misses 4080 4080 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merged
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.
Summary
The memory-pressure ingress throttle added in
694ea643c(PR #3083) has a feedback-loop failure mode: when system memory is held high by buffered event objects in queues, the throttle slows the only thing that reduces queue size (ScanIngress), which keeps memory high, which keeps the throttle engaged. In the pathological case (modules killed, only dedup-drop work left to clear), scans get trapped draining at <1 event/sec for hours.The mechanism
_ingress_delaybecomes ~1.9s/event at 91.9% per the linear formula in_compute_ingress_delay.q.get_nowait()— throughput collapses to ~0.5 events/sec.User observation: closing an unrelated program (dropping system memory below threshold) caused the scan to immediately zip through hundreds of thousands of queued events. Confirms the throttle was the entire bottleneck.
Fix
In the status-loop recompute (
scanner.py), force_ingress_delay = 0.0when no non-intercept module has work in flight or queued. In that state ingress IS the drain, so throttling it is counterproductive. Predicate checksrunning OR outgoing_queue OR num_incoming_eventsto avoid false-clearing during a momentary lull in healthy operation.