feat(memory): Add script to debug consumer OOM issues #6585
+50
−2
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
From initial investigations it has been found that rebalances could potentially be the reason for some of our consumers having high memory usage. Added a script which mimics the behavior. I can also see the increase in memory usage locally. This will make it easier to triage the problem by potentially using memory profiler locally.
The script uses a parameter
-g
optionally to generate spans on the topic. If you need data, then run with that option. It always resets offsets to 0 between re-runs. So if you have enough data on kafka, you do not need to pass the-g
option.Logs of running the script and seeing memory increases
On my machine, I was able to use up more than 2GB of memory easily.
Verfification that rebalances were being triggered
Logs of the kafka broker