fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

[Feature Request] provide option to throw_exception/block before buffer queue is full

Open ryn9 opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe.

Due to some issues I have have been experiencing, I believe it would make sense to provide options to throw_exception/block before the buffer queue is full.

When preforming tests with file buffering I have noted at least these issues: https://github.com/fluent/fluent-plugin-opensearch/issues/35 https://github.com/fluent/fluent-plugin-opensearch/issues/34

Even with these issues resolved, I believe providing options to throw_exception/block before the buffer queue is full makes sense.

Describe the solution you'd like

I would suggest adding to the buffering and/or flushing parameters: https://docs.fluentd.org/configuration/buffer-section#buffering-parameters https://docs.fluentd.org/configuration/buffer-section#flushing-parameters

Options to set a high-water mark percentage, similar to chunk_full_threshold, and an action, similar to the overflow_action would be required.

For example: chunk_highwater_action - throw_exception/block chunk_highwater_threshold - percentage of chunk size threshold for executing chunk_highwater_action

Describe alternatives you've considered

N/A

Additional context

N/A

ryn9 avatar Mar 19 '22 22:03 ryn9

Do we need to implement back pressure feature?

e.g) https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/buffer.rb#L295

cosmo0920 avatar Mar 25 '22 02:03 cosmo0920

Do we need to implement back pressure feature?

I would very much welcome a full featured back pressure feature. A full featured back pressure mechanism requires harmony between output plugins, buffers, and input plugins. I do believe, though, my above request would be helpful in the interim, without impacting much of the plumbing.

ryn9 avatar Mar 25 '22 13:03 ryn9

@cosmo0920 does my last comment make sense?

ryn9 avatar Mar 31 '22 17:03 ryn9

Yeah, makes sense but implementing it on Fluentd core is very challenging task for now.

cosmo0920 avatar Apr 04 '22 12:04 cosmo0920

@cosmo0920 - might these two be easier to implement?

[Feature Request] implement RPC endpoints to stop and start sources #3692 [Feature Request] supply monitor_agent stats via RPC or update without_source to skip type monitor_agent #3694

If so - we could use external scripts to monitor and control the up/down state of the sources :)

ryn9 avatar Apr 04 '22 15:04 ryn9