Lennart,

as I said, I did not inspect the code myself. But after having configured a 
persistent journal, I realized that reading the whole journal took over two 
minutes to complete (while the logs just for the current boot is rather fast).
In contrast reading all files after flushing the caches just took a short 
moment.
First support said they could not reproduce, but after some time support told 
me that reading the journal did not complete even after 15 minutes.
Also the number of fstat calls perf counted does not seem wrong.

Kind regards,
Ulrich Windl
 
Klinikum der Universität Regensburg
IT / Infrastruktur
 
Franz-Josef-Strauß-Allee 11
D-93053 Regensburg

Tel: +49 941 944-13816
Softphone: +49 941 944-801142
FAX: +49 941 944-5882

> -----Original Message-----
> From: Lennart Poettering <lenn...@poettering.net>
> Sent: Wednesday, May 7, 2025 10:14 AM
> To: Windl, Ulrich <u.wi...@ukr.de>
> Cc: František Šumšal <franti...@sumsal.cz>; systemd-
> de...@lists.freedesktop.org
> Subject: [EXT] Re: [systemd-devel] Re: slowness reading persistent journal
> 
> 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