Skip to content
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

Fix in_monitor_agent's buffer_total_queued_size #1990

Conversation

kimutansk
Copy link

@kimutansk kimutansk commented May 18, 2018

Abstract

Now, in_monitor_agent's buffer_total_queued_size does't count queued chunk's sizes.
So fix for counting them.

Problem

  • Version: Fluent1.1.3

  • Buffer Settings

<buffer topic,tag>
  @type                       file
  path                        "/var/log/td-agent/buffer/#{ENV['PROCESS_NAME']}.forward_to_kafka.*.log"
  queued_chunks_limit_size    10000
  chunk_limit_size            32m
  total_limit_size            2400m
  flush_mode                  interval
  flush_interval              1.0
  flush_thread_burst_interval 0.1
  flush_thread_count          5
  retry_forever               true
  retry_max_interval          30s
  overflow_action             drop_oldest_chunk
</buffer>
  • When that buffer plugin occured dropping oldest chunk to make space after buffer overflow, in_monitor agent returned below results.
plugin_category:output	type:kafka2	output_plugin:true	buffer_queue_length:10002	buffer_total_queued_size:39154788	retry_count:395

Queued total buffer size was about 2400mb, but in_monitor_agent's output was under 40mb, they were significantly different.

Reason

in_monitor_agent counts only stage_size, does't count queue_size.

https://github.com/fluent/fluentd/blob/v1.1.3/lib/fluent/plugin/in_monitor_agent.rb#L282

Fix detail

Fix in_monitor_agent's buffer_total_queued_size for counting queued chunk's sizes.

Fixed environment, in_monitor_agent's output was below, about 2400mb.

plugin_category:output	type:kafka2	output_plugin:true	buffer_queue_length:10002	buffer_total_queued_size:2513712017	retry_count:12

@repeatedly
Copy link
Member

Could you update test?

@kimutansk
Copy link
Author

Sorry, I missed.
Fixed in_monitor_agent's test.

@repeatedly repeatedly merged commit 9830b27 into fluent:master May 21, 2018
@repeatedly
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants