]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/journal/journald-server.h
journald: add minimal client metadata caching 6392/head
authorLennart Poettering <lennart@poettering.net>
Mon, 17 Jul 2017 21:36:35 +0000 (23:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 31 Jul 2017 16:21:21 +0000 (18:21 +0200)
commit22e3a02b9d618bbebcf987bc1411acda367271ec
tree9de58289d618e16a8e1ebab6769476bb9440f7fc
parent47b33c7d5284492e5679ccfabafe8c9738de8cb3
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.
src/journal/journald-audit.c
src/journal/journald-context.c [new file with mode: 0644]
src/journal/journald-context.h [new file with mode: 0644]
src/journal/journald-kmsg.c
src/journal/journald-native.c
src/journal/journald-server.c
src/journal/journald-server.h
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/journal/meson.build