From 8580d1f73db36e9383e674e388b4fb55828c0c66 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 2 Oct 2015 23:21:59 +0200 Subject: journal: rework vacuuming logic Implement a maximum limit on number of journal files to keep around. Enforcing a limit is useful on this since our performance when viewing pays a heavy penalty for each journal file to interleve. This setting is turned on now by default, and set to 100. Also, actully implement what 348ced909724a1331b85d57aede80a102a00e428 promised: use whatever we find on disk at startup as lower bound on how much disk space we can use. That commit introduced some provisions to implement this, but actually never did. This also adds "journalctl --vacuum-files=" to vacuum files on disk by their number explicitly. --- man/journalctl.xml | 26 ++++++++++++++++++-------- man/journald.conf.xml | 23 +++++++++++++++++------ 2 files changed, 35 insertions(+), 14 deletions(-) (limited to 'man') diff --git a/man/journalctl.xml b/man/journalctl.xml index 305f1b9412..3efcfbd6bf 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -649,6 +649,7 @@ + Removes archived journal files until the disk space they use falls below the specified size (specified with @@ -658,15 +659,24 @@ timespan (specified with the usual s, min, h, days, months, - weeks, years - suffixes). Note that running - has only indirect effect on the output shown by + weeks, years suffixes), + or no more than the specified number of separate journal files + remain. Note that running has + only indirect effect on the output shown by as the latter includes active - journal files, while the former only operates on archived - journal files. and - may be combined in a single - invocation to enforce both a size and time limit on the - archived journal files. + journal files, while the the vacuuming operation only operates + on archived journal files. Similar, + might not actually reduce the + number of journal files to below the specified number, as it + will not remove active journal + files. , + and + may be combined in a single + invocation to enforce any combination of a size, a time and a + number of files limit on the archived journal + files. Specifying any of these three parameters as zero is + equivalent to not enforcing the specific limit, and is thus + redundant. diff --git a/man/journald.conf.xml b/man/journald.conf.xml index d6fe45d40c..109ca960fb 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -173,9 +173,11 @@ SystemMaxUse= SystemKeepFree= SystemMaxFileSize= + SystemMaxFiles= RuntimeMaxUse= RuntimeKeepFree= RuntimeMaxFileSize= + RuntimeMaxFiles= Enforce size limits on the journal files stored. The options prefixed with System @@ -197,8 +199,7 @@ names not ending with .journal or .journal~, so only such files, located in the appropriate directories, are taken into account when - calculating current disk usage. - + calculating current disk usage. SystemMaxUse= and RuntimeMaxUse= control how much disk space @@ -212,13 +213,14 @@ The first pair defaults to 10% and the second to 15% of the size of the respective file system. If the file system is nearly full and either SystemKeepFree= or - RuntimeKeepFree= is violated when - systemd-journald is started, the value will be raised to + RuntimeKeepFree= are violated when + systemd-journald is started, the limit will be raised to the percentage that is actually free. This means that if there was enough free space before and journal files were created, and subsequently something else causes the file system to fill up, journald will stop using more space, but it will not be - removing existing files to go reduce footprint either. + removing existing files to reduce footprint again + either. SystemMaxFileSize= and RuntimeMaxFileSize= control how large @@ -228,13 +230,22 @@ eighth of the values configured with SystemMaxUse= and RuntimeMaxUse=, so that usually seven - rotated journal files are kept as history. + rotated journal files are kept as history. Specify values in bytes or use K, M, G, T, P, E as units for the specified sizes (equal to 1024, 1024²,... bytes). Note that size limits are enforced synchronously when journal files are extended, and no explicit rotation step triggered by time is needed. + + SystemMaxFiles= and + RuntimeMaxFiles= control how many + individual journal files to keep at maximum. Note that only + archived files are deleted to reduce the number of files until + this limit is reached; active files will stay around. This + means that in effect there might still be more journal files + around in total than this limit after a vacuuming operation is + complete. This setting defaults to 100. -- cgit v1.2.3-54-g00ecf From 32252660954804747ae6b64c3921d5cb9a1c09c9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 3 Oct 2015 11:34:11 +0200 Subject: man: document that the automatic journal limits are capped to 4G by default Fixes #1441. --- man/journald.conf.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'man') diff --git a/man/journald.conf.xml b/man/journald.conf.xml index 109ca960fb..4464fe53ad 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -211,8 +211,9 @@ and use the smaller of the two values. The first pair defaults to 10% and the second to 15% of - the size of the respective file system. If the file system is - nearly full and either SystemKeepFree= or + the size of the respective file system, but each value is + capped to 4G. If the file system is nearly full and either + SystemKeepFree= or RuntimeKeepFree= are violated when systemd-journald is started, the limit will be raised to the percentage that is actually free. This means that if there was -- cgit v1.2.3-54-g00ecf From fd8d05e9b85c7973339e58d9bc1e5ccd4f5c98b7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 3 Oct 2015 11:40:16 +0200 Subject: man: fix journalctl --syslog-identifier= documentation We don't actually accept patterns, hence don't claim so. This is a fix-up for 730836403aee5f5bb998e6e3622ea7068fce0699. Fixes #1256. --- man/journalctl.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'man') diff --git a/man/journalctl.xml b/man/journalctl.xml index 3efcfbd6bf..db3f166e65 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -437,13 +437,11 @@ - + Show messages for the specified syslog - identifier SYSLOG_IDENTIFIER, or - for any of the messages with a - SYSLOG_IDENTIFIER matched by - PATTERN. + identifier + SYSLOG_IDENTIFIER. This parameter can be specified multiple times. -- cgit v1.2.3-54-g00ecf From 6c1695be47b2830c79e128e4d05d760eb862184e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 3 Oct 2015 11:54:43 +0200 Subject: man: include numeric prefixes in example file names for .link, .netdev, .network files In order to avoid confusion with the default files we ship, let's use a low prefix number for all examples. Fixes #1409. --- man/systemd.link.xml | 2 +- man/systemd.netdev.xml | 20 ++++++++++---------- man/systemd.network.xml | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'man') diff --git a/man/systemd.link.xml b/man/systemd.link.xml index b630ef7a17..dfff785e46 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -383,7 +383,7 @@ Example - /etc/systemd/network/wireless.link + /etc/systemd/network/25-wireless.link [Match] MACAddress=12:34:56:78:9a:bc diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 05bbad7f65..9f0afad853 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -909,7 +909,7 @@ Example - /etc/systemd/network/bridge.netdev + /etc/systemd/network/25-bridge.netdev [NetDev] Name=bridge0 @@ -917,7 +917,7 @@ Kind=bridge - /etc/systemd/network/vlan1.netdev + /etc/systemd/network/25-vlan1.netdev [Match] Virtualization=no @@ -930,7 +930,7 @@ Kind=vlan Id=1 - /etc/systemd/network/ipip.netdev + /etc/systemd/network/25-ipip.netdev [NetDev] Name=ipip-tun Kind=ipip @@ -942,7 +942,7 @@ Remote=192.169.224.239 TTL=64 - /etc/systemd/network/tap.netdev + /etc/systemd/network/25-tap.netdev [NetDev] Name=tap-test Kind=tap @@ -952,7 +952,7 @@ MultiQueue=true PacketInfo=true - /etc/systemd/network/sit.netdev + /etc/systemd/network/25-sit.netdev [NetDev] Name=sit-tun Kind=sit @@ -964,7 +964,7 @@ Remote=10.65.223.239 - /etc/systemd/network/gre.netdev + /etc/systemd/network/25-gre.netdev [NetDev] Name=gre-tun Kind=gre @@ -976,7 +976,7 @@ Remote=10.65.223.239 - /etc/systemd/network/vti.netdev + /etc/systemd/network/25-vti.netdev [NetDev] Name=vti-tun @@ -989,7 +989,7 @@ Remote=10.65.223.239 - /etc/systemd/network/veth.netdev + /etc/systemd/network/25-veth.netdev [NetDev] Name=veth-test Kind=veth @@ -999,7 +999,7 @@ Name=veth-peer - /etc/systemd/network/bond.netdev + /etc/systemd/network/25-bond.netdev [NetDev] Name=bond1 Kind=bond @@ -1013,7 +1013,7 @@ LACPTransmitRate=fast - /etc/systemd/network/dummy.netdev + /etc/systemd/network/25-dummy.netdev [NetDev] Name=dummy-test Kind=dummy diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 629088ea81..2bb793619e 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -893,7 +893,7 @@ DHCP=yes - /etc/systemd/network/bridge-static.network + /etc/systemd/network/25-bridge-static.network [Match] Name=bridge0 @@ -905,7 +905,7 @@ DNS=192.168.0.1 - /etc/systemd/network/bridge-slave-interface.network + /etc/systemd/network/25-bridge-slave-interface.network [Match] Name=enp2s0 @@ -914,7 +914,7 @@ Name=enp2s0 Bridge=bridge0 - /etc/systemd/network/ipip.network + /etc/systemd/network/25-ipip.network [Match] Name=em1 @@ -924,7 +924,7 @@ Tunnel=ipip-tun - /etc/systemd/network/sit.network + /etc/systemd/network/25-sit.network [Match] Name=em1 @@ -934,7 +934,7 @@ Tunnel=sit-tun - /etc/systemd/network/gre.network + /etc/systemd/network/25-gre.network [Match] Name=em1 @@ -944,7 +944,7 @@ Tunnel=gre-tun - /etc/systemd/network/vti.network + /etc/systemd/network/25-vti.network [Match] Name=em1 @@ -954,7 +954,7 @@ Tunnel=vti-tun - /etc/systemd/network/bond.network + /etc/systemd/network/25-bond.network [Match] Name=bond1 -- cgit v1.2.3-54-g00ecf