From e6db76b5baa675b4ae018d02ee36236d36fdbbb1 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 6 Nov 2013 12:43:10 +0100
Subject: make "write all mark messages" default behaviour -- improves
processing speed
---
action.c | 20 ++++++++++----------
doc/rsyslog_conf_actions.html | 10 ++++++++--
doc/v8compatibility.html | 6 ++++++
3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/action.c b/action.c
index e63a01e3..cbca4faa 100644
--- a/action.c
+++ b/action.c
@@ -18,7 +18,7 @@
* - actionWriteToAction
* - qqueueEnqObj
* (now queue engine processing)
- * if(pThis->bWriteAllMarkMsgs == RSFALSE) - this is the DEFAULT
+ * if(pThis->bWriteAllMarkMsgs == RSFALSE)
* - doSubmitToActionQNotAllMark
* - doSubmitToActionQ (and from here like in the else case below!)
* else
@@ -326,7 +326,7 @@ rsRetVal actionConstruct(action_t **ppThis)
pThis->iResumeInterval = 30;
pThis->iResumeRetryCount = 0;
pThis->pszName = NULL;
- pThis->bWriteAllMarkMsgs = RSFALSE;
+ pThis->bWriteAllMarkMsgs = 1;
pThis->iExecEveryNthOccur = 0;
pThis->iExecEveryNthOccurTO = 0;
pThis->iSecsExecOnceInterval = 0;
@@ -406,12 +406,12 @@ actionConstructFinalize(action_t *pThis, struct nvlst *lst)
"iExecEveryNthOccur=%d, iSecsExecOnceInterval=%d\n",
pThis->iExecEveryNthOccur, pThis->iSecsExecOnceInterval);
pThis->submitToActQ = doSubmitToActionQComplex;
- } else if(pThis->bWriteAllMarkMsgs == RSFALSE) {
- /* nearly full-speed submission mode, default case */
- pThis->submitToActQ = doSubmitToActionQNotAllMark;
- } else {
- /* full firehose submission mode */
+ } else if(pThis->bWriteAllMarkMsgs) {
+ /* full firehose submission mode, default case*/
pThis->submitToActQ = doSubmitToActionQ;
+ } else {
+ /* nearly full-speed submission mode */
+ pThis->submitToActQ = doSubmitToActionQNotAllMark;
}
/* create queue */
@@ -1305,7 +1305,7 @@ doSubmitToActionQComplex(action_t *pAction, wti_t *pWti, msg_t *pMsg)
// TODO: can we optimize the "now" handling again (was batch, I guess...)?
/* don't output marks to recently written outputs */
- if(pAction->bWriteAllMarkMsgs == RSFALSE
+ if(pAction->bWriteAllMarkMsgs == 0
&& (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
ABORT_FINALIZE(RS_RET_OK);
}
@@ -1482,7 +1482,7 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData,
pAction->bRepMsgHasMsg = cs.bActionRepMsgHasMsg;
cs.iActExecEveryNthOccur = 0; /* auto-reset */
cs.iActExecEveryNthOccurTO = 0; /* auto-reset */
- cs.bActionWriteAllMarkMsgs = RSFALSE; /* auto-reset */
+ cs.bActionWriteAllMarkMsgs = 1; /* auto-reset */
cs.pszActionName = NULL; /* free again! */
} else {
actionApplyCnfParam(pAction, actParams);
@@ -1579,7 +1579,7 @@ resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unus
static inline void
initConfigVariables(void)
{
- cs.bActionWriteAllMarkMsgs = RSFALSE;
+ cs.bActionWriteAllMarkMsgs = 1;
cs.glbliActionResumeRetryCount = 0;
cs.bActExecWhenPrevSusp = 0;
cs.iActExecOnceInterval = 0;
diff --git a/doc/rsyslog_conf_actions.html b/doc/rsyslog_conf_actions.html
index 5d7a5bdb..b0fe011e 100644
--- a/doc/rsyslog_conf_actions.html
+++ b/doc/rsyslog_conf_actions.html
@@ -31,8 +31,14 @@ implemented via output modules.
used for statistics gathering and documentation
type string
Mandatory parameter for every action. The name of the module that should be used.
- action.writeAllMarkMessages on/off
-
Normally, mark messages are written to actions only if the action was not recently executed (by default, recently means within the past 20 minutes). If this setting is switched to "on", mark messages are always sent to actions, no matter how recently they have been executed. In this mode, mark messages can be used as a kind of heartbeat. Note that this option auto-resets to "off", so if you intend to use it with multiple actions, it must be specified in front off all selector lines that should provide this functionality.
+ action.writeAllMarkMessages on/off
+
This setting tells if mark messages are always written ("on", the default) or only
+ if the action was not recently executed ("off"). By default, recently means within the
+ past 20 minutes. If this setting is "on", mark messages are always sent to actions, no
+ matter how recently they have been executed. In this mode, mark messages can be used as
+ a kind of heartbeat. This mode also enables faster processing inside the rule engine. So
+ it should be set to "off" only when there is a good reason to do so.
+
action.execOnlyEveryNthTime integer
If configured, the next action will only be executed every n-th time. For example, if configured to 3, the first two messages that go into the action will be dropped, the 3rd will actually cause the action to execute, the 4th and 5th will be dropped, the 6th executed under the action, ... and so on. Note: this setting is automatically re-set when the actual action is defined.
action.execOnlyEveryNthTimeout integer
diff --git a/doc/v8compatibility.html b/doc/v8compatibility.html
index aedc755f..4aa9be41 100644
--- a/doc/v8compatibility.html
+++ b/doc/v8compatibility.html
@@ -13,6 +13,12 @@ Most importantly, pre-v8 plugins do not longer work and need to
be updated to support the new calling interfaces. If you developed a plugin,
be sure to review the developer section below.
+Mark Messages
+In previous versions, mark messages were by default only processed if an
+action was not executed for some time. The default has now changed, and mark
+messages are now always processed. Note that this enables faster processing
+inside rsyslog. To change to previous behaviour, you need to add
+action.writeAllMarkMessages="off" to the actions in question.
What Developers need to Know
output plugin interface
To support the new core engine, the output interface has been considerably
--
cgit v1.2.3