Skip to content

Conversation

@Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Mar 25, 2025

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
Previous, I changed lifespan of iobuf at #4763 to work GC collector well.

In addition, it seems that clearing iobuf manually when it is no longer needed, it might improve memory efficiency.

memory_usage

  • config
<source>
  @type tail
  path "#{File.expand_path '~/tmp/access*.log'}"
  pos_file "#{File.expand_path '~/tmp/fluentd/access.log.pos'}"
  tag log
  refresh_interval 5s
  <parse>
    @type none
  </parse>
</source>

<match **>
  @type file
  path "#{File.expand_path '~/tmp/log'}"
</match>
  • script to generate log data
require "json"

path = File.expand_path("~/tmp/access.log")

File.open(path, "w") do |f|
  loop do
    log = { time: Time.now, message: "a" * 10_000 }.to_json
    f.puts log
    sleep 0.05
  end
end

Related to #4808

Docs Changes:

Release Note:

@Watson1978 Watson1978 marked this pull request as ready for review March 25, 2025 09:35
@Watson1978 Watson1978 requested a review from daipom March 25, 2025 09:35
Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@daipom daipom added this to the v1.19.0 milestone Mar 26, 2025
@daipom
Copy link
Contributor

daipom commented Mar 26, 2025

Mainly about #4763, I'm a little concerned about any unexpected negative effects on the processing speed of in_tail.
It would be good to check the changes in processing speed and memory consumption for the v1.19 release.

@daipom daipom merged commit 61d7a8e into fluent:master Mar 26, 2025
10 checks passed
@Watson1978 Watson1978 deleted the in_tail branch March 26, 2025 04:21
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