From bbfc80c579c0c3fd8e5bddf8cf88532113df67e9 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 13 Aug 2019 12:22:24 -0500 Subject: performance fix for podman events with large journalds in the case where the host has a large journald, iterating the journal without using a Match is very poor performance. this might be a temporary fix while we figure out why the systemd library does not seem to behave properly. Signed-off-by: baude --- libpod/events/journal_linux.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpod/events') diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go index 3bc3f6de7..470c76959 100644 --- a/libpod/events/journal_linux.go +++ b/libpod/events/journal_linux.go @@ -73,6 +73,11 @@ func (e EventJournalD) Read(options ReadOptions) error { if err := j.SeekTail(); err != nil { return errors.Wrap(err, "failed to seek end of journal") } + } else { + podmanJournal := sdjournal.Match{Field: "SYSLOG_IDENTIFIER", Value: "podman"} //nolint + if err := j.AddMatch(podmanJournal.String()); err != nil { + return errors.Wrap(err, "failed to add filter for event log") + } } // the api requires a next|prev before getting a cursor if _, err := j.Next(); err != nil { -- cgit v1.2.3-54-g00ecf