[systemd-devel] [PATCH] journal: Leave server_dispatch_message early when Storage is none

Holger Hans Peter Freyther holger at freyther.de
Thu Jul 18 05:45:12 PDT 2013


From: Holger Hans Peter Freyther <holger at moiji-mobile.com>

When using Storage=none there is no point in collecting all the
information just to throw them away. After this change journald
consumes a lot less CPU time when only forwarding messages.
---
 src/journal/journald-server.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 369ebf4..f3599b7 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -862,6 +862,11 @@ void server_dispatch_message(
         if (LOG_PRI(priority) > s->max_level_store)
                 return;
 
+        /* Stop early in case the information will not be stored
+         * in a journal. */
+        if (s->storage == STORAGE_NONE)
+                return;
+
         if (!ucred)
                 goto finish;
 
-- 
1.8.3.2



More information about the systemd-devel mailing list