-
Notifications
You must be signed in to change notification settings - Fork 0
Add log throttling per file #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bd39c23 to
8a1d6ae
Compare
8a1d6ae to
f9eef2b
Compare
domleb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question and comment around the design:
- The throttling is done based on lines but would it be better to throttle based on bytes so we can handle varying line sizes more predictably / reliably?
- The solution in place only works if the
watch_timeris enabled and thestat_watcher(inotify) is disabled, because if we enablestat_watcherit will trigger more lines to be read (if the app is still logging) and therefore defeat the throttle. However, the preferred (by fluentd) config is the opposite for both. Therefore I don't think this approach would be acceptable for fluentd and as the plan is to merge these change back in I think we should start with a design that is compatible withstat_watcher. We should also be aiming to move back tostat_watcheras we only disabled this because fluentd was getting stuck, but it still does get stuck and we have a liveliness probe to handle that.
|
@domleb I've updated the code with a new commit adding throttling per bytes and also it should work with any config now: The tail plugin is single threaded so having |
f3ac9b8 to
a4ec3f2
Compare
Remove debug log Signed-off-by: Anthony Comtois <[email protected]>
a4ec3f2 to
8ab733c
Compare
Signed-off-by: Anthony Comtois <[email protected]>
…otify Signed-off-by: Anthony Comtois <[email protected]>
Signed-off-by: Anthony Comtois <[email protected]>
Signed-off-by: Anthony Comtois <[email protected]>
8ab733c to
416693c
Compare
What this PR does / why we need it:
Running in a big cluster with high volume of log, it would be nice to throttle the log shipping to avoid network saturation and make it easier to calculate the max throughput per node for example in a Kubernetes cluster.
Tail plugin is watching files and every second reading from the last pointer to the end of the file.
This change allow to stop reading the file after X number of logs lines read and update the pointer in the pos file as usual.
Docs Changes:
read_lines_limit_per_notifywhich by default is set to-1, so no throttling involve by default.