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

Lennart Poettering lennart at poettering.net
Wed Jan 28 11:36:08 PST 2015

On Wed, 14.01.15 09:05, Ben Greear (greearb at candelatech.com) wrote:

> I would like to grab the last 2000 or so system log lines after
> some event happens.  I tried this on Fedora-20 (systemd version 208).
> It seems unreasonable slow:
> [root at ath10k lanforge]# time journalctl -n 2000 > /tmp/foo.txt
> real	0m25.618s
> user	0m2.361s
> sys	0m23.197s
> Is there any way to configure things so that this is faster?

There have been a number of changes to speed things up
recently. Please recheck with a more current version of systemd.

Also, is this btrfs? If so, btrfs cannot handle our write pattern
particularly well, and can get excessively slow. On current
development versions of systemd I thus changed it to disable the COW
mode for journal files, which should make this less of a problem.


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list