[systemd-devel] Why is journalctl -b so slow?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Fri Nov 20 09:39:14 UTC 2020


Hi!

journactl -b is quite fast to display the first lines, but when I want to see the last lines, it's quite slow. The journal is on BtrFS that is on a hardware RAID made from two SSDs, so the _filesystem_ should not be the problem (actually it seems the journal is in tmpfs actually):

### done after being called before, so the file contents should be cached anyway.
# time journalctl -b |wc -l
2018589

real    0m21.890s
user    0m19.053s
sys     0m3.292s

Reading all files to compare:
 # time cat /run/log/journal/e766c8d06f144b1588487221640f55b5/* |wc -l
3203984

real    0m0.729s
user    0m0.135s
sys     0m0.962s

 # df /run
Filesystem     1K-blocks    Used Available Use% Mounted on
tmpfs          131889480 1664768 130224712   2% /run

systemd-234-24.61.1.x86_64 from SLES15 SP2.

Regards,
Ulrich




More information about the systemd-devel mailing list