systemd-journald writes 49KB+ per log line on ext4, 110KB+ on btrfs

Single log line is 49KB+ (ext4) / 110KB+ (btrfs) of systemd-journald disk writes

systemd-journald writes 49KB+ per log line on ext4, 110KB+ on btrfs

A GitHub issue reports that systemd-journald causes excessive disk I/O, with a single log line triggering 49KB+ of writes on ext4 and 110KB+ on btrfs. The reporter demonstrates that even at just two log lines per second, a VM sustains ~50 IOPS, far exceeding syslog's efficiency. They argue the journal format is extremely inefficient, and the issue references a previously closed duplicate (#15292). Other users confirm similar problems, with one seeing nearly 7GB written in 15 minutes and another providing detailed measurements showing 752 bytes of actual data resulting in over 200KB of writes.

Journald just uses extremely inefficient format (also I've seen it corrupt on unclean reboot enough times to declare it's not even all that resilient) as files are also multiple times the size of what's actually written in them.
  1. 0x_rs

    journald is awful for many reasons, but what makes it worse is that everything running on your machine thinks it has any rights to dump all the logs it wants unprompted. Open a file picker and kio will decide it's a good idea to spam tens or hundreds of thousands of entries into it a day, listing every single file you have in a directory with some log such as "No node found for item that was just removed" and that has zero impact to the user whatsoever. You almost need to keep a script tracking all the journal floods for every new service to make sure it's not treating your system log as its dumping ground. To be fair, the kernel and usb peripherals can also have a bad day and spam 3 million lines an hour into it, think input irq status -75.

    It's too much of a chore to keep up with all the program-level configs (if they have them) and service files, but LogFilterPatterns in systemd can help in an unintended way: you can make one log blacklist with a .conf file in /etc/systemd/system/service.d/, and put in there all the patterns that spam your journal one by one, don't even have to chase misattributed loglevels. It just looks something like:

    [Service]

    LogFilterPatterns=~I am a completely useless log entry

    LogFilterPatterns=~I am another useless log entry

    But it doesn't pick up on identifiers and doesn't do anything for kernel spam. It's only great to make some messages shut up. Also, I'd consider any btrfs install that does not have nocow on cache, journal etc. to be defective […]

  2. jck86

    The cherry on the cake is that you practically cannot filter journald. The only option is limiting by severity (e.g. errors and higher) or switch to non persistent journald storage and forward to rsyslog and filter there.

    Am a bit vague on the details but sometimes a driver goes bezerk and starts logging many times per second, e.g. a bug in amdgpu after resume from suspend. Took a while to get that filtered which luckily was only possible because it were kernel messages (dmesg), but for a while I had to disae persistent kernel logging which is dat from ideal.

    I get that for certain core parts simplicity is more important than features. But journald is just too basic to enable persistent storage but I also don't want to switch it off.

  3. otterley

    Something must have happened along the way, because this was not the original design intent of the database (emphasis mine):

    """

    The native journal file format is inspired by classic log files as well as git repositories. It is designed in a way that log data is only attached at the end (in order to ensure robustness and atomicity with mmap()-based access), with some meta data changes in the header to reference the new additions. The fields, an entry consists off, are stored as individual objects in the journal file, which are then referenced by all entries, which need them. This saves substantial disk space since journal entries are usually highly repetitive (think: every local message will include the same _HOSTNAME= and _MACHINE_ID= field). Data fields are compressed in order to save disk space. The net effect is that even though substantially more meta data is logged by the journal than by classic syslog the disk footprint does not immediately reflect that.

    """

    See https://docs.google.com/document/u/0/d/1IC9yOXj7j6cdLLxWEBAG...

  4. barrkel

    journald is IMO the worst part of the systemd ecosystem. You're better off using it only as a router and not storing any logs in it. The indexing system it uses is slow and provides no control over chatty subsystems - you cannot truncate the logs for just a single identifier. For all the use indexing is doing you will get better performance out of a modern grep like ag or rg. Structure is worth something but it's better off somewhere other than journald.

  5. smartmic

    I recently looked into disk usage of journald and was also shocked. My next step towards peace of mind is https://www.devuan.org/os/init-freedom

    Will try it out as next distro for my Debian system, longtime experience with Void Linux (runit) on another box is great.

  6. pudgywalsh

    How do you try to copy Windows NT's Event Log — which is essentially unchanged from the 1990s when systems ran on 32MB of RAM or less — and fail so spectacularly?

    The first thing I do on a Linux system is install a proper syslog daemon.

  7. ValdikSS

    https://github.com/systemd/systemd/issues/40262#issuecomment...

  8. amluto

    Ooh, mmapped writes. I make that mistake once, years ago. :) I posted a comment in that GH issue.

More from this day

2026-08-13