diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-19 17:46:19 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-19 17:46:19 +0100 |
commit | cdce0bde4b3b2f77ecdf8a9ba2e4772fb92ff20d (patch) | |
tree | 1e1d0efeaea569463e59aa833ec46fb7db76a5a6 | |
parent | 88fa72fef9279aa20f4e52080131f06af7e9cc53 (diff) | |
download | rsyslog-cdce0bde4b3b2f77ecdf8a9ba2e4772fb92ff20d.tar.gz rsyslog-cdce0bde4b3b2f77ecdf8a9ba2e4772fb92ff20d.tar.bz2 rsyslog-cdce0bde4b3b2f77ecdf8a9ba2e4772fb92ff20d.zip |
queue: auto-adjust watermarks
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | action.c | 4 | ||||
-rw-r--r-- | runtime/queue.c | 24 |
3 files changed, 19 insertions, 12 deletions
@@ -1,5 +1,8 @@ --------------------------------------------------------------------------- Version 7.5.7 [v7-devel] 2013-11-?? +- queue defaults have changed + * high water mark is now dynamically 90% of queue size + * low water makr is now dynamically 70% of queue size - bugfix: segfault on startup when certain script constructs are used e.g. "if not $msg ..." - bugfix: ommysql lost configfile/section parameters after first close @@ -254,8 +254,8 @@ actionResetQueueParams(void) cs.ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */ cs.iActionQueueSize = 1000; /* size of the main message queue above */ cs.iActionQueueDeqBatchSize = 16; /* default batch size */ - cs.iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */ - cs.iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */ + cs.iActionQHighWtrMark = -1; /* high water mark for disk-assisted queues */ + cs.iActionQLowWtrMark = -1; /* low water mark for disk-assisted queues */ cs.iActionQDiscardMark = 980; /* begin to discard messages */ cs.iActionQDiscardSeverity = 8; /* discard warning and above */ cs.iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ diff --git a/runtime/queue.c b/runtime/queue.c index 56fd9905..c9d064d6 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1373,8 +1373,8 @@ qqueueSetDefaultsActionQueue(qqueue_t *pThis) pThis->qType = QUEUETYPE_DIRECT; /* type of the main message queue above */ pThis->iMaxQueueSize = 1000; /* size of the main message queue above */ pThis->iDeqBatchSize = 128; /* default batch size */ - pThis->iHighWtrMrk = 800; /* high water mark for disk-assisted queues */ - pThis->iLowWtrMrk = 200; /* low water mark for disk-assisted queues */ + pThis->iHighWtrMrk = -1; /* high water mark for disk-assisted queues */ + pThis->iLowWtrMrk = -1; /* low water mark for disk-assisted queues */ pThis->iDiscardMrk = 980; /* begin to discard messages */ pThis->iDiscardSeverity = 8; /* turn off */ pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */ @@ -1403,8 +1403,8 @@ qqueueSetDefaultsRulesetQueue(qqueue_t *pThis) pThis->qType = QUEUETYPE_FIXED_ARRAY; /* type of the main message queue above */ pThis->iMaxQueueSize = 50000; /* size of the main message queue above */ pThis->iDeqBatchSize = 1024; /* default batch size */ - pThis->iHighWtrMrk = 45000; /* high water mark for disk-assisted queues */ - pThis->iLowWtrMrk = 20000; /* low water mark for disk-assisted queues */ + pThis->iHighWtrMrk = -1; /* high water mark for disk-assisted queues */ + pThis->iLowWtrMrk = -1; /* low water mark for disk-assisted queues */ pThis->iDiscardMrk = 49500; /* begin to discard messages */ pThis->iDiscardSeverity = 8; /* turn off */ pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */ @@ -2117,18 +2117,22 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */ * we correct the most important shortcomings. */ goodval = (pThis->iMaxQueueSize / 100) * 60; - if(pThis->iHighWtrMrk < goodval) { + if(pThis->iHighWtrMrk != -1 && pThis->iHighWtrMrk < goodval) { errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, "queue \"%s\": high water mark " "is set quite low at %d. You should only set it below " "60%% (%d) if you have a good reason for this.", obj.GetName((obj_t*) pThis), pThis->iHighWtrMrk, goodval); } + if(pThis->iHighWtrMrk < 2 || pThis->iHighWtrMrk > pThis->iMaxQueueSize) + pThis->iHighWtrMrk = (pThis->iMaxQueueSize / 100) * 90; + if( pThis->iLowWtrMrk < 2 + || pThis->iLowWtrMrk > pThis->iMaxQueueSize + || pThis->iLowWtrMrk > pThis->iHighWtrMrk ) + pThis->iLowWtrMrk = (pThis->iMaxQueueSize / 100) * 70; if(pThis->iFullDlyMrk == -1 || pThis->iFullDlyMrk > pThis->iMaxQueueSize) - pThis->iFullDlyMrk = pThis->iMaxQueueSize - - (pThis->iMaxQueueSize / 100) * 3; /* default 97% */ + pThis->iFullDlyMrk = (pThis->iMaxQueueSize / 100) * 97; if(pThis->iLightDlyMrk == -1 || pThis->iLightDlyMrk > pThis->iMaxQueueSize) - pThis->iLightDlyMrk = pThis->iMaxQueueSize - - (pThis->iMaxQueueSize / 100) * 30; /* default 70% */ + pThis->iLightDlyMrk = (pThis->iMaxQueueSize / 100) * 70; if(pThis->iMaxQueueSize > 0 && pThis->iDeqBatchSize > pThis->iMaxQueueSize) pThis->iDeqBatchSize = pThis->iMaxQueueSize; @@ -2163,7 +2167,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */ } DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, maxQSize %d, lqsize %d, pqsize %d, child %d, " - "full delay %d, light delay %d, deq batch size %d starting, high wtrmrk %d, low wtrmrk %d\n" + "full delay %d, light delay %d, deq batch size %d starting, high wtrmrk %d, low wtrmrk %d, " "max wrkr %d, min msgs f. wrkr %d\n", pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize, pThis->iMaxQueueSize, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), |