4 ms·
I don't have enough RAM that journal is usually in cache (just anecdotally, it seems to always be slow the first time in a session that I run it). Nonetheless,
by gue5t 9y ago
I don't have enough RAM that journal is usually in cache (just anecdotally, it seems to always be slow the first time in a session that I run it). Nonetheless, I can access most uncached contents of my disk much faster than this:
$ time journalctl -r | head -n 50
(...)
journalctl -r 0,01s user 0,04s system 0% cpu 5,289 total
head -n 50 0,00s user 0,00s system 0% cpu 5,287 total
If your lifestyle involves embracing the capitalist consumption treadmill of buying new hardware every couple of years, systemd-journald may be for you. Otherwise prepare to be told to throw away perfectly good computer hardware because Lennart is too lazy to design software that can cope gracefully with disk latency.
- duskwuff 9y ago"journalctl -r" is loading all the available logs on your system. If you only want the most recent 50 lines, use "journalctl -r -n 50".
- gue5t 9y agoIt certainly isn't; it's killed by SIGPIPE after printing 50 lines. If I wanted to wait for the entire system log to read off of disk I'd be sitting for minutes. "journalctl -r -n 50" takes 5.4 seconds as of a test just now from (this time, artificially) cold cache.