Repository navigation
(WIP) Drop Items from Perfdata writers' work queues when backend is stalled - #11169
Draft
jschmidt-icinga wants to merge 3 commits into
Draft
jschmidt-icinga wants to merge 3 commits into
jschmidt-icinga wants to merge 3 commits into
Conversation
jschmidt-icinga
force-pushed
the
perfdata-workqueue-drop-when-stalled
branch
from
November 12, 2026 14:17
be0522f to
a002488
Compare
jschmidt-icinga
force-pushed
the
perfdata-workqueue-drop-when-stalled
branch
from
November 12, 2026 14:22
a002488 to
5638986
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.
First preview version with only
GraphiteWriteras a basis for discussion (not even that for now).Currently this works by Cancelling the
PerfdataWriterConnectionwhen a configurable queue size is reached. Then inside the queues the entries cancel themselves until we're under the threshold again (within a certain amount of hysteresis).This is a bit inelegant and awkward, but the advantage is that when the backend reappears the beginning of the gap will line up with the time it went out and the maximum amount of new perfdata will be sent right away.
I've also set the default value of the threshold to 1000000 entries for now, which is 1/10 the maximum queue size and on my testing setup results in ~1.2GiB of memory usage, though this is obviously subject to vary based on the checks being run and other factors and will vary even more between the individual writers.
I do think that we absolutely have to make this value configurable for the user because there is no reliable way to use any memory pressure heuristic for this, due to the diverse environments Icinga 2 will run in. I think the default can be pretty generous (or there might even be an argument for keeping it off by default), because we can just rely on the documentation and community to refer users that run into this issue to the solution.
TODO
Fixes #10630 (eventually).