Bug 72601

Summary: journalctl -b -<boot#>: very slow startup on slow filesystems, large journals
Product: systemd Reporter: Alain Kalker <a.c.kalker>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: a.c.kalker, david, radek
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Alain Kalker 2013-12-11 15:57:37 UTC
Investigating why a diskless client (booted over NFS) crashed, I noticed that:

$ mount -o nolock,ro <nfs-server>:/nfs/<clientroot> mnt
$ journalctl -b -0 -D mnt/var/log/journal

took almost 6 seconds before showing the log.
The NFS 'server' is a consumer grade router with a hard disk attached to its USB port, resulting in reasonably slow transfer speeds, but which are otherwise acceptable for its intended purpose.

From experience with a few other systems, startup time for journalctl increases as the number of boots recorded and the journal size increases. I believe this may be due to the high number of disk accesses required to find the beginning of entries pertaining to the last boot in the journal.

This bug report is a request for improving the access speed of specific boot journal entries.
Comment 1 Alain Kalker 2013-12-13 17:31:38 UTC
Update: after suffering a graphics driver issue on my main desktop, I noticed that:

$ journalctl -b -1

took almost 40(!) seconds to begin displaying log entries.
(As may be obvious, this machine has rebooted lots of times, and the journal dir takes up quite a lot of disk space.)
Comment 2 Alain Kalker 2013-12-13 17:41:04 UTC
If journalctl is to seriously take on the competition of logrotated syslog, then IMHO fixing this delay should be high priority.

In some cases (the proverbial printer being on fire, but in particular CPUs overheating in a server rack, etc), quick access to the logs is very important.
Comment 3 David Heidelberg (okias) 2014-09-26 09:09:58 UTC
same issue, systemd-215
Comment 5 Lennart Poettering 2015-05-20 16:58:52 UTC
Jan Janssen's patches that improve this have been merged now. Hence closing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.