[systemd-devel] How to speed up journalctl -n foo ?

Matthias Urlichs matthias at urlichs.de
Wed Jan 14 10:42:05 PST 2015


Hi,

Ben Greear:
> > real	0m25.618s
> > user	0m2.361s
> > sys	0m23.197s
> > 
Something seems broken here. Do you have any old and/or inconsistent
journal files lying around?

> [root at ath9k-f ~]# time tail -2000 /var/log/messages > /tmp/foo.txt
> 
> real	0m0.005s
> user	0m0.002s
> sys	0m0.003s
> 
To be fair, journalctl is of course slower if you don't filter for
anything -- but the -nX case should be fast enough anyway.

$ time journalctl -n 2000 > /tmp/foo.txt

real	0m0.068s
user	0m0.056s
sys	0m0.008s

-- 
-- Matthias Urlichs


More information about the systemd-devel mailing list