Skip to content

(WIP) Drop Items from Perfdata writers' work queues when backend is stalled - #11169

Draft
jschmidt-icinga wants to merge 3 commits into
masterfrom
perfdata-workqueue-drop-when-stalled
Draft

jschmidt-icinga wants to merge 3 commits into
masterfrom
perfdata-workqueue-drop-when-stalled

Conversation

@jschmidt-icinga

@jschmidt-icinga jschmidt-icinga commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First preview version with only GraphiteWriter as a basis for discussion (not even that for now).

Currently this works by Cancelling the PerfdataWriterConnection when 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

  • Get approval on and finish the design
  • Implement the remaining writers
  • Fine-tune default values
  • Documentation

Fixes #10630 (eventually).

@cla-bot cla-bot Bot added the cla/signed label Nov 12, 2026
@jschmidt-icinga
jschmidt-icinga force-pushed the perfdata-workqueue-drop-when-stalled branch from be0522f to a002488 Compare November 12, 2026 14:17
@jschmidt-icinga
jschmidt-icinga force-pushed the perfdata-workqueue-drop-when-stalled branch from a002488 to 5638986 Compare November 12, 2026 14:22
@jschmidt-icinga jschmidt-icinga added this to the 2.17.0 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

work queue items grow infinite after influxdbwriter runs into an exception

1 participant