From b49ff958d5dfb01a85fb0d5c394b1ba7d9a74d2d 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(+) diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go index 2854e6548..e7e919d6d 100644 --- a/libpod/events/journal_linux.go +++ b/libpod/events/journal_linux.go @@ -70,6 +70,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