Systemd/src/journal
Zbigniew Jędrzejewski-Szmek 6aae0b1af4 journald: lower keep_free to 5% and raise min_use to 2%
https://bugzilla.redhat.com/show_bug.cgi?id=1715699

> /dev/mapper/live-rw  6.4G  5.7G  648M  91% /
> systemd-journald[905]: Fixed min_use=1.0M max_use=648.7M max_size=81.0M min_size=512.0K keep_free=973.1M n_max_files=100

When journald is started, we pick keep_free as 15% of the disk size. When the
fs is almost filled, we will only keep one journal file around and rotate very
often (because min_size is very small).

Let's set min use to something reasonable, so that we get more useful logs that
will cover at least the full boot.

Some cases considered in the PR:

> /dev/mapper/live-rw 6.4G 5.7G 648M 91% /

keep_free→MIN(327,100)→100 MB.
min_use→16MB.
effective range: 16 MB – 548 MB

> /dev/mapper/fedora_krowka-root 78G 69G 5.7G 93% /

keep_free → MIN(4GB, 100MB)→100MB
min_use→16MB
effective range: 16 MB – 5.6 GB
(but then there's the max_use limit, which cuts the range down)

> 4TB, 4GB free

keep_free → MIN(209715, 100) → 100 MB
min_use→16MB
effective range: 16 MB – 4.9 GB
(also effectively limited by max_use)

Also replace unneeded width suffixes with spaces, I think this is more
readable, and drop DEFAULT_ prefixes in cases where this setting is
simply a bound, and cannot be overridden by user config, hence is not
a default.
2019-07-26 16:45:49 +02:00
..
audit-type.c journal: use missing_audit.h to generate audit_type-list.txt 2018-12-07 11:48:37 +09:00
audit-type.h tree-wide: use newa() instead of alloca() wherever we can 2019-01-26 16:17:04 +01:00
audit_type-to-name.awk meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
cat.c Merge pull request #12411 from keszybz/pr/12394 2019-05-08 10:11:32 -04:00
catalog.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
catalog.h headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
compress.c journal: properly read unaligned le64 integers 2019-07-16 15:22:26 +02:00
compress.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
fsprg.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
fsprg.h tree-wide: use '#pragma once' for header guard 2018-08-30 06:10:43 +03:00
generate-audit_type-list.sh scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
journal-authenticate.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
journal-authenticate.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journal-def.h tree-wide: drop duplicated blank lines 2019-07-15 18:41:27 +02:00
journal-file.c journald: lower keep_free to 5% and raise min_use to 2% 2019-07-26 16:45:49 +02:00
journal-file.h journal: use cleanup attribute at one more place 2019-05-28 18:07:18 +09:00
journal-internal.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journal-qrcode.c Add open_memstream_unlocked() wrapper 2019-04-12 11:44:57 +02:00
journal-qrcode.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journal-send.c util: split out errno related stuff 2019-03-14 13:25:51 +01:00
journal-vacuum.c util: introduce format_bytes_full() 2019-06-19 23:15:19 +09:00
journal-vacuum.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journal-verify.c journalctl: don't output ANSI sequences if disabled 2019-05-10 15:00:55 -04:00
journal-verify.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journalctl.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
journald-audit.c tree-wide: drop alloca() in loop 2019-06-20 06:29:19 +09:00
journald-audit.h tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
journald-console.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journald-console.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journald-context.c basic/process-util: convert bool arg to flags 2019-05-22 10:15:49 +02:00
journald-context.h headers: add missing includes 2019-03-28 19:59:56 +01:00
journald-gperf.gperf journal: make the compression threshold tunable 2018-03-20 14:54:07 -07:00
journald-kmsg.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
journald-kmsg.h tests: add a fuzzer for dev_kmsg_record 2018-11-16 08:44:35 +01:00
journald-native.c journald: use memdup_suffix0() when copying string from potentially binary data 2019-06-18 20:53:46 +03:00
journald-native.h journald: make server_process_native_message compatible with fuzz_journald_processing_function 2018-09-03 07:03:52 +00:00
journald-rate-limit.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
journald-rate-limit.h headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
journald-server.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
journald-server.h journald: also offer flush/rotate/sync as varlink method calls 2019-05-09 14:14:20 -04:00
journald-stream.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
journald-stream.h tests: add a fuzzer for journald streams 2018-11-20 03:03:32 +01:00
journald-syslog.c tree-wide: some automatic coccinelle fixes (#10463) 2018-10-20 00:07:46 +09:00
journald-syslog.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journald-wall.c journald: drop copyright headers for Sebastian Thorarensen 2018-07-03 01:32:25 +02:00
journald-wall.h headers: add missing includes 2019-03-28 19:59:56 +01:00
journald.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
journald.conf journal: add missing option in journald.conf 2018-06-26 04:05:42 +09:00
lookup3.c journal: also disable memory tricks when hashing under msan 2019-06-12 17:27:19 +02:00
lookup3.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
meson.build meson: create /var/log/journal/{,remote/} conditionally 2019-07-04 10:16:48 +02:00
mmap-cache.c util: split out errno related stuff 2019-03-14 13:25:51 +01:00
mmap-cache.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
sd-journal.c tree-wide: replace strjoina() with prefix_roota() 2019-06-25 01:31:26 +09:00
test-audit-type.c Drop my copyright headers 2018-06-14 13:03:20 +02:00
test-catalog.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-compress-benchmark.c util: split out nulstr related stuff to nulstr-util.[ch] 2019-03-14 13:25:52 +01:00
test-compress.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-journal-config.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-journal-enum.c tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
test-journal-flush.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
test-journal-init.c test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL 2019-04-04 12:18:13 +02:00
test-journal-interleaving.c tree-wide: use PROJECT_FILE instead of __FILE__ 2019-07-04 10:36:00 +02:00
test-journal-match.c tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
test-journal-send.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-journal-stream.c test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL 2019-04-04 12:18:13 +02:00
test-journal-syslog.c test-journal-syslog: initialize variable 2018-09-25 11:34:52 +02:00
test-journal-verify.c test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL 2019-04-04 12:18:13 +02:00
test-journal.c test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL 2019-04-04 12:18:13 +02:00
test-mmap-cache.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00