[systemd-devel] Journalctl Unit Completion Optmization
Lennart Poettering
lennart at poettering.net
Wed Apr 22 09:37:06 PDT 2015
On Tue, 03.03.15 23:02, Justin Brown (justin.brown at fandingo.org) wrote:
> Hello,
>
> I've recently been using journalctl on one of my longer-lived systems, and
> I'm running into a slight annoyance. Most of the time I'm using `journalctl
> -u <<unit>> -e`. I use tab completion for the unit name, and the annoyance
> is the long pause journalctl takes to complete a unit. With cold cache
> (meaning writing 3 to /proc/sys/vm/drop_caches), this takes 23 seconds on a
> system using Btrfs on a SATA3 SSD. With warm cache, it still takes 3-4
> seconds. Both cases are quite a bit slower than normal tab completion
> behavior.
Is it really that bad if the files on btrfs are defragmented properly?
Note that btrfs is notoriously bad at handling journald's write
pattern currently, which results in heavily fragmented files. Use the
"filefrag" tool to check how fragmented they are, and use btrfs defrag
to the fix this.
Before we look into other options I'd really prefer if you could check
if this already fixes your issues.
(Note that very recent journald will set the btrfs NOCOW flag now on
the journal files, which should work around this issue.)
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list