Systemd/src/journal
Lennart Poettering 22e3a02b9d journald: add minimal client metadata caching
Cache client metadata, in order to be improve runtime behaviour under
pressure.

This is inspired by @vcaputo's work, specifically:

https://github.com/systemd/systemd/pull/2280

That code implements related but different semantics.

For a longer explanation what this change implements please have a look
at the long source comment this patch adds to journald-context.c.

After this commit:

        # time bash -c 'dd bs=$((1024*1024)) count=$((1*1024)) if=/dev/urandom | systemd-cat'
        1024+0 records in
        1024+0 records out
        1073741824 bytes (1.1 GB, 1.0 GiB) copied, 11.2783 s, 95.2 MB/s

        real	0m11.283s
        user	0m0.007s
        sys	0m6.216s

Before this commit:

        # time bash -c 'dd bs=$((1024*1024)) count=$((1*1024)) if=/dev/urandom | systemd-cat'
        1024+0 records in
        1024+0 records out
        1073741824 bytes (1.1 GB, 1.0 GiB) copied, 52.0788 s, 20.6 MB/s

        real	0m52.099s
        user	0m0.014s
        sys	0m7.170s

As side effect, this corrects the journal's rate limiter feature: we now
always use the unit name as key for the ratelimiter.
2017-07-31 18:21:21 +02:00
..
audit-type.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
audit-type.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
audit_type-to-name.awk meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
cat.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
catalog.c tree-wide: make ++/-- usage consistent WRT spacing 2016-02-22 20:32:04 -08:00
catalog.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
compress.c journal: fix warning about LZ4_compress_limitedOutput 2016-12-10 13:52:49 -05:00
compress.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
fsprg.c journal/fsprg: set -Wno-pointer-arithm only for that file 2017-04-23 21:47:26 -04:00
fsprg.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
generate-audit_type-list.sh meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
journal-authenticate.c Merge pull request #2589 from keszybz/resolve-tool-2 2016-02-13 11:15:41 +01:00
journal-authenticate.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-def.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-file.c journal: avoid unnecessary mmap_cache_get() calls 2017-07-12 23:59:29 -07:00
journal-file.h journal: explicitly add fds to mmap-cache (#6307) 2017-07-10 19:24:56 -04:00
journal-internal.h sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
journal-qrcode.c tree-wide: fput[cs]() → fput[cs]_unlocked() wherever that makes sense (#6396) 2017-07-21 10:35:45 +02:00
journal-qrcode.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-send.c sd-journal: suppress empty lines 2016-07-19 17:51:20 +02:00
journal-vacuum.c journalctl: say in which directory we vacuum stuff 2016-10-12 20:25:20 +02:00
journal-vacuum.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-verify.c journal: return mapped size from mmap_cache_get() 2017-07-12 23:58:48 -07:00
journal-verify.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journalctl.c shared: leave output_journal() output in buffer (#6304) 2017-07-07 14:32:21 -04:00
journald-audit.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-audit.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-console.c journal/journald-console: fix format-specifier issue 2017-05-19 14:23:22 +02:00
journald-console.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-context.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-context.h journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-gperf.gperf journald: make reading /dev/kmsg optional (#6362) 2017-07-15 13:57:52 +02:00
journald-kmsg.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-kmsg.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-native.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-native.h Move export format parsing from src/journal-remote/ to src/basic/ 2017-02-14 23:56:48 -05:00
journald-rate-limit.c journald: add comment explaining journal rate limit return codes 2017-07-31 18:20:28 +02:00
journald-rate-limit.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-server.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-server.h journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-stream.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-stream.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-syslog.c journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
journald-syslog.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-wall.c Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
journald-wall.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald.c tree-wide: make use of getpid_cached() wherever we can 2017-07-20 20:27:24 +02:00
journald.conf core: rename StartLimitInterval= to StartLimitIntervalSec= 2016-04-29 16:27:48 +02:00
lookup3.c journal/lookup3: silence gcc 7 implicit-fallthrough warning 2017-01-31 14:04:55 -05:00
lookup3.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
meson.build journald: add minimal client metadata caching 2017-07-31 18:21:21 +02:00
mmap-cache.c Merge pull request #6355 from vcaputo/journal_avoid_mmap_cache_get_calls 2017-07-17 10:03:52 +02:00
mmap-cache.h journal: return mapped size from mmap_cache_get() 2017-07-12 23:58:48 -07:00
sd-journal.c tree-wide: make use of getpid_cached() wherever we can 2017-07-20 20:27:24 +02:00
test-audit-type.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-catalog.c fileio: simplify mkostemp_safe() (#4090) 2016-09-13 08:20:38 +02:00
test-compress-benchmark.c Merge pull request #6365 from keszybz/fast-tests 2017-07-28 11:09:50 +02:00
test-compress.c test-compress*: silence warning about unused definitions when w/o both xz and lz4 2017-04-19 19:27:01 -04:00
test-journal-enum.c tree-wide: make ++/-- usage consistent WRT spacing 2016-02-22 20:32:04 -08:00
test-journal-flush.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal-init.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-interleaving.c tests: get rid of strerror 2016-09-13 20:10:57 -04:00
test-journal-match.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-send.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-stream.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal-syslog.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-verify.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-mmap-cache.c journal: return mapped size from mmap_cache_get() 2017-07-12 23:58:48 -07:00