diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-06 12:43:10 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-06 12:43:10 +0100 |
commit | e6db76b5baa675b4ae018d02ee36236d36fdbbb1 (patch) | |
tree | 7325903f142b7017a12affae3adb33bab4cbf536 | |
parent | 2a94703425c6fb29b7e9d0a00090c83731dead61 (diff) | |
download | rsyslog-e6db76b5baa675b4ae018d02ee36236d36fdbbb1.tar.gz rsyslog-e6db76b5baa675b4ae018d02ee36236d36fdbbb1.tar.bz2 rsyslog-e6db76b5baa675b4ae018d02ee36236d36fdbbb1.zip |
make "write all mark messages" default behaviour -- improves processing speed
-rw-r--r-- | action.c | 20 | ||||
-rw-r--r-- | doc/rsyslog_conf_actions.html | 10 | ||||
-rw-r--r-- | doc/v8compatibility.html | 6 |
3 files changed, 24 insertions, 12 deletions
@@ -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 <a href="rsyslog_conf_modules.html#om">output modules</a>. <br>used for statistics gathering and documentation <li><b>type</b> string <br>Mandatory parameter for every action. The name of the module that should be used. </li> - <li><b>action.writeAllMarkMessages</b> on/off - <br>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. </li> + <li><b>action.writeAllMarkMessages</b> <i>on</i>/off + <br>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. + </li> <li><b>action.execOnlyEveryNthTime</b> integer <br>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.</li> <li><b>action.execOnlyEveryNthTimeout</b> 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 <b>do not longer work</b> and need to be updated to support the new calling interfaces. If you developed a plugin, be sure to review the developer section below. </p> +<h2>Mark Messages</h2> +<p>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. <h2>What Developers need to Know</h2> <h3>output plugin interface</h3> <p>To support the new core engine, the output interface has been considerably |