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

in_tail: readpartial maxlen is too small #2416

Closed
methane opened this issue May 24, 2019 · 3 comments · Fixed by #2418
Closed

in_tail: readpartial maxlen is too small #2416

methane opened this issue May 24, 2019 · 3 comments · Fixed by #2418

Comments

@methane
Copy link
Member

methane commented May 24, 2019

We use fluentd to transfer line based large log file; about 4GiB / hour and 1495 byte / line.

$ wc apache2.acc.21.log
   2949500  242309651 4410569207 apache2.acc.21.log

CPU usage of fluentd is very high. We tried sigdump and it shows this line every time:

@fifo << io.readpartial(2048, @iobuf)

I feel maxlen=2048 is too small, at least on our case. It reads only one or two lines on each call.

FYI, tail command in coreutils uses BUFSIZ in stdio.h, and BUFSIZ in Debian and Ubuntu is 8192.

In case of ruby, overhead of calling io.readpartial will be higher than read in C. Would you change the maxlen to at least 8192?


  • fluentd or td-agent version: 1.3.3
  • Environment information:
    • Operating system: cat /etc/os-release: "Debian GNU/Linux 9 (stretch)"
    • Kernel version: uname -r: 4.9.0-5-amd64
  • Your configuration
<source>
  @type tail
  path /.../web/%Y-%m-%d/apache2.acc.%H.log
  pos_file /.../td-agent/web.acc.pos
  read_from_head
  tag web.acc
  format none
  enable_stat_watcher false
</source>
@repeatedly
Copy link
Member

@nurse Do you see any concern for increasing this value?

@nurse
Copy link
Contributor

nurse commented May 25, 2019

@repeatedly Using 8192 sounds reasonable.

@repeatedly
Copy link
Member

@methane Could you send a pull request?

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 a pull request may close this issue.

3 participants