systemd - How to decrease metadata disk usage of journald logs? - Ask Ubuntu


myuser@myhost:~$ sudo journalctl > log.txt myuser@myhost:~$ sudo journalctl --disk-usage archived , active journals take 3.0g on disk. myuser@myhost:~$ ls -lh log.txt  -rw-rw-r-- 1 myuser myuser 298m oct 31 15:15 log.txt 

so journal using 3g of disk space, actual log entries ~300m. imagine journal metadata taking rest of it.

is possible change ratio of metadata log entries? or maybe it's not metadata else?

almost of logs generated containerized apps, dockerd --log-driver=journald

update:

my journald.conf:

[journal] storage=persistent ratelimitinterval=0 ratelimitburst=0 forwardtosyslog=no 

first, see reported "on disk" may not on disk @ all. clarified in recent bug fix, new language says "in file system", may in in-memory file system or disk-backed. default in ubuntu 16.04, it's memory-backed, there's bug report make systemd journal persistent default in ubuntu.

now how reduce space. if you're not sure start find documentation on journald, man -k journald helpful see if have related documentation installed already:

$ man -k journald journald.conf (5)    - journal service configuration files journald.conf.d (5)  - journal service configuration files systemd-journald (8) - journal service systemd-journald-audit.socket (8) - journal service systemd-journald-dev-log.socket (8) - journal service systemd-journald.service (8) - journal service systemd-journald.socket (8) - journal service 

since seem looking tune configuration, man journald.conf place check. there you'll find docs several options related disk space, can read details there. here's summary:

  • compress=, enabled default, compresses data
  • systemmaxuse= , runtimemaxuse= control how disk space journal may use @ most.
  • maxretentionsec= maximum time store journal entries.

see mentioned man page full docs edit /etc/systemd/journald.conf.

finally systemctl daemon-reload && systemctl reload systemd-journald make changes take effect.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User