-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve consumer metric cleanup when a channel goes down #9356
Conversation
With this PR, when I kill an app process that has 10K consumers on one channel, I observe a short spike of CPU usage from ≈ 0.3% to ≈ 5% which then instantly goes back to ≈ 0.3%. |
Ah, the original test was with over 100K consumers on a channel. I re-tested with 200K consumers and CPU usage drops to 14% within a few seconds, and to virtually zero in the next 40s-60s, so this definitely provides an improvement over the behavior described in #9320. |
Improve consumer metric cleanup when a channel goes down (backport #9356)
This improves sample cleanup for a few channels with an extremely large number of consumers but regresses when there's a large number of channels with one consumer, which is more common. Passing consumer info as context when a channel is closed would help avoid the scan introduced in this PR entirely. |
Or, alternatively, the two approaches can be combined:
|
To clarify, its |
(cherry picked from commit dad9379)
Proposed Changes
This update improves metric cleanup of consumer data when a channel goes down by:
See #9320 for background.
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.