You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are cases when you need to handle only the load you agreed on, and drop the rest (some sort of internal service with SLA). This plugin does exactly this. We have some rate per second, and we drop messages above it. It implements leaky bucket, based on sliding window algorithm.
There are couple of things we could improve on though (looking forward to your suggestions):
I would like to have a background time ticker, don't know how to make it using fluent-bit framework. Should I wake up on the event, or some background thread is enough.
Do you think we need different time ranges, like per minute, per hour etc?
Do think anything can be improved? I got 1 core nocked out for more than 100k req/sec.
What do you think about the idea in general?
onorua
changed the title
Throttling filter
[WIP] Throttling filter
Nov 1, 2017
@edsiper should I create something similar to flb_input_set_collector_time for filter? Do you think such a functionality can be merged when done, or this is something you don't want in mainline?
If this plugin is for a production use-case I am happy to have it there.
regarding your questions:
I would like to have a background time ticker, don't know how to make it using fluent-bit framework
Ideally this need to have a time_collector into the filters which don't exists at the moment. I think it's necessary, I can add the bits for that.
Should I wake up on the event, or some background thread is enough.
I think Fix include paths #1 is enough
Do you think we need different time ranges, like per minute, per hour etc?
do you have more use-cases ?, I would like to learn more from that.
Do think anything can be improved? I got 1 core nocked out for more than 100k req/sec.
do you mean to increase performance ?
Yes, we have this in production for some time and really happy about it. Give me couple of days for tests coverage. I'll split this PR into 2 PRs one for throttling and another one for elastic search index regexp.
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
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.
There are cases when you need to handle only the load you agreed on, and drop the rest (some sort of internal service with SLA). This plugin does exactly this. We have some rate per second, and we drop messages above it. It implements leaky bucket, based on sliding window algorithm.
There are couple of things we could improve on though (looking forward to your suggestions):
What do you think about the idea in general?