On Mi, 07.05.25 06:48, Windl, Ulrich (u.wi...@ukr.de) wrote:

> Hi!
>
> SLES Support is working on it, and that support claimed that
> journalctl would output the journal line-by-line, calling fstat for
> each journal file for each line to output. So for 100 journal files
> and 6 million lines of journal, that number would be simply
> crazy. Most of all I'd wonder what the original programmer did think
> about it: Modern systems are fast anyway, so any algorithm would do?
> Disclaimer: I did not inspect the actual code; it's just what
> support told me.

yeah, this is not what happens. It's very easy to see:

  # strace -o log -s 500 -y journalctl -n 100 --no-pagerstrace -o log -s 500 -y 
journalctl -n 100 --no-pager
  # grep fstat\( log

This looks for fstat() calls on the output of 100 log lines. As you
can see each journal file is fstat()ed once, not 100 times.

Hence, your support line is wrong.

Lennart

--
Lennart Poettering, Berlin

Reply via email to