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

formatter_json: use JSON as fallback parser instead of Yajl for performance #4835

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

Watson1978
Copy link
Contributor

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
Recently, Ruby's json has incredible performance improvements.
It might be faster than oj gem.
So, I think json is a suitable as fallback.

This is similar with #4813

  • Before

    • It spent 70.708872503 sec to handle 10 GB file
  • After

    • It spent 54.428017716 sec to handle 10 GB file
  • config

<source>
  @type tail
  path "#{File.expand_path('~/tmp/fluentd/access*.log')}"
  pos_file "#{File.expand_path('~/tmp/fluentd/access.log.pos')}"
  tag log
  read_from_head true
  <parse>
    @type none
  </parse>
</source>

<match **>
  @type file
  path "#{File.expand_path('~/tmp/fluentd/output/log')}"

  # use formatter_json
  format json
</match>

Docs Changes:

Release Note:

@daipom daipom self-requested a review February 18, 2025 05:22
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 Feb 21, 2025
@daipom daipom merged commit 3227e05 into fluent:master Feb 21, 2025
9 of 10 checks passed
@Watson1978 Watson1978 deleted the formatter_json branch February 22, 2025 00:28
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