-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use flush_thread_count value for queued_chunks_limit_size when queued_chunks_limit_size is not specified #2173
Use flush_thread_count value for queued_chunks_limit_size when queued_chunks_limit_size is not specified #2173
Conversation
…_chunks_limit_size is not specified Unlimited queued_chunks_limit_size causes unexpected resource consumption when the destination has a problem with smaller flush_interval. The default behaviour should be safe so use flush_thread_count by default. Signed-off-by: Masahiro Nakagawa <[email protected]>
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.
Patch intention seems good.
But some test cases conflicts old and new behavior.
Could you check it?
@@ -372,7 +372,7 @@ def write(metadata_and_data, format: nil, size: nil, enqueue: false) | |||
end | |||
|
|||
def queue_full? | |||
@queued_chunks_limit_size && (synchronize { @queue.size } >= @queued_chunks_limit_size) | |||
synchronize { @queue.size } >= @queued_chunks_limit_size |
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.
buffer test complains @queued_chunks_limit_sise
is nil and not to be able to compare.
Could you check it?
https://travis-ci.org/fluent/fluentd/jobs/452714881#L547
@@ -354,6 +354,10 @@ def configure(conf) | |||
log.warn "'flush_interval' is ignored because default 'flush_mode' is not 'interval': '#{@flush_mode}'" | |||
end | |||
end | |||
|
|||
if @buffer.queued_chunks_limit_size.nil? | |||
@buffer.queued_chunks_limit_size = @buffer_config.flush_thread_count |
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.buffer.queue.size
always seems to be assumed 1 in test cases.
Could you check it?
https://travis-ci.org/fluent/fluentd/jobs/452714881#L654
We have smaller queued_chunks_limit_size tests so set larger value, 100 in this patch, is enough for existing tests. Signed-off-by: Masahiro Nakagawa <[email protected]>
I forgot to change tests. Just push the fix. |
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.
LGTM!
I've run test cases locally and confirmed all tests are passed.
This increases the number of chunks that can be queued to be sent to S3. The [documentation][1] claims that this number is unlimited when not set, but the default was in fact [recently set][2] to `1`, which causes a backlog of chunks to build up when there is a larger number of log files. [1]: https://docs.fluentd.org/v1.0/articles/buffer-section#buffering-parameters [2]: fluent/fluentd#2173
This increases the number of chunks that can be queued to be sent to S3. The [documentation][1] claims that this number is unlimited when not set, but the default was in fact [recently set][2] to `1`, which causes a backlog of chunks to build up when there is a larger number of log files. [1]: https://docs.fluentd.org/v1.0/articles/buffer-section#buffering-parameters [2]: fluent/fluentd#2173 Signed-off-by: Christian Berg <[email protected]>
This increases the number of chunks that can be queued to be sent to S3. The [documentation][1] claims that this number is unlimited when not set, but the default was in fact [recently set][2] to `1`, which causes a backlog of chunks to build up when there is a larger number of log files. [1]: https://docs.fluentd.org/v1.0/articles/buffer-section#buffering-parameters [2]: fluent/fluentd#2173 Signed-off-by: Christian Berg <[email protected]> Signed-off-by: njuettner <[email protected]>
Unlimited queued_chunks_limit_size causes unexpected resource consumption, e.g. lots of smaller files with file buffer, when
the destination has a problem with smaller flush_interval.
The default behaviour should be safe so use flush_thread_count by default.
Signed-off-by: Masahiro Nakagawa [email protected]