From fd7e1fc72e81dc366eae70171bb8d68685121c62 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 22 Mar 2008 09:53:07 +0000 Subject: changed queue's discard severities default value to 8 (do not discard) to prevent unintentional message loss --- ChangeLog | 2 ++ action.c | 2 +- doc/queues.html | 12 +++++++----- syslogd.c | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c96cb874..191915a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ Version 3.12.4 (rgerhards), 2008-03-?? the patch - bugfix: fixed some minor memory leaks - bugfix: some slightly invalid memory accesses +- changed queue's discard severities default value to 8 (do not discard) + to prevent unintentional message loss --------------------------------------------------------------------------- Version 3.12.3 (rgerhards), 2008-03-18 - added advanced flow control for congestion cases (mode depending on message diff --git a/action.c b/action.c index 0f4c1db6..99ae8b32 100644 --- a/action.c +++ b/action.c @@ -63,7 +63,7 @@ static int iActionQueueSize = 1000; /* size of the main message queue above * static int iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */ static int iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */ static int iActionQDiscardMark = 9800; /* begin to discard messages */ -static int iActionQDiscardSeverity = 4; /* discard warning and above */ +static int iActionQDiscardSeverity = 8; /* by default, discard nothing to prevent unintentional loss */ static int iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ static uchar *pszActionQFName = NULL; /* prefix for the main message queue file */ static int64 iActionQueMaxFileSize = 1024*1024; diff --git a/doc/queues.html b/doc/queues.html index 41aa9992..2498da1b 100644 --- a/doc/queues.html +++ b/doc/queues.html @@ -2,7 +2,6 @@ Understanding rsyslog queues -

Understanding rsyslog Queues

@@ -17,7 +16,7 @@ rule processor, which then evaluates which actions are to be carried out. In front of each action, there is also a queue, which potentially de-couples the filter processing from the actual action (e.g. writing to file, database or forwarding to another host).

-

Queue Modes

+

iQueue Modes

Rsyslog supports different queue modes, some with submodes. Each of them has specific advantages and disadvantages. Selecting the right queue mode is quite important when tuning rsyslogd. The queue mode (aka "type") is set via the "$<object>QueueType" @@ -243,9 +242,12 @@ This directive accepts both the usual textual severity as well as a numerical one. To understand it, you must be aware of the numerical severity values. They are defined in RFC 3164:

        Numerical         Severity
Code

0 Emergency: system is unusable
1 Alert: action must be taken immediately
2 Critical: critical conditions
3 Error: error conditions
4 Warning: warning conditions
5 Notice: normal but significant condition
6 Informational: informational messages
7 Debug: debug-level messages
-

Anything of the specified severity and (numerically) above it is discarded. -To turn message discarding off, simply specify the discard watermark to be -higher than the queue size.

+

Anything of the specified severity and (numerically) above it is +discarded. To turn message discarding off, simply specify the discard +watermark to be higher than the queue size. An alternative is to +specify the numerical value 8 as DiscardSeverity. This is also the +default setting to prevent unintentional message loss. So if you would +like to use message discarding, you need to set" $<object>QueueDiscardSeverity" to an actual value.

An interesting application is with disk-assisted queues: if the discard watermark is set lower than the high watermark, message discarding will start before the queue becomes disk-assisted. This may be a good thing if you would diff --git a/syslogd.c b/syslogd.c index 9e7f80cb..58ecb16a 100644 --- a/syslogd.c +++ b/syslogd.c @@ -335,7 +335,7 @@ static int iMainMsgQueueSize = 10000; /* size of the main message queue above static int iMainMsgQHighWtrMark = 8000; /* high water mark for disk-assisted queues */ static int iMainMsgQLowWtrMark = 2000; /* low water mark for disk-assisted queues */ static int iMainMsgQDiscardMark = 9800; /* begin to discard messages */ -static int iMainMsgQDiscardSeverity = 4; /* discard warning and above */ +static int iMainMsgQDiscardSeverity = 8; /* by default, discard nothing to prevent unintentional loss */ static int iMainMsgQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ static queueType_t MainMsgQueType = QUEUETYPE_FIXED_ARRAY; /* type of the main message queue above */ static uchar *pszMainMsgQFName = NULL; /* prefix for the main message queue file */ -- cgit