summaryrefslogtreecommitdiffstats
path: root/runtime/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-08-01 15:56:34 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-08-01 15:56:34 +0200
commita789813b14de79c5ecac8b0d7f7c222ae7f47412 (patch)
tree7e850b1085fd1bdb2223154a3cc96480320ca334 /runtime/queue.c
parentd0bab973d2ddf93af71c859f3ed47dd40d561c76 (diff)
downloadrsyslog-a789813b14de79c5ecac8b0d7f7c222ae7f47412.tar.gz
rsyslog-a789813b14de79c5ecac8b0d7f7c222ae7f47412.tar.xz
rsyslog-a789813b14de79c5ecac8b0d7f7c222ae7f47412.zip
milestone: queue-params are properly initialized for action queues
Diffstat (limited to 'runtime/queue.c')
-rw-r--r--runtime/queue.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 5f224e7e..f390d987 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1318,6 +1318,40 @@ finalize_it:
}
+/* set default inisde queue object suitable for action queues.
+ * This shall be called directly after queue construction. This functions has
+ * been added in support of the new v6 config system. It expect properly pre-initialized
+ * objects, but we need to differentiate between ruleset main and action queues.
+ * In order to avoid unnecessary complexity, we provide the necessary defaults
+ * via specific function calls.
+ */
+void
+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->iDiscardMrk = 9800; /* begin to discard messages */
+ pThis->iDiscardSeverity = 8; /* turn off */
+ pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */
+ pThis->iMaxFileSize = 1024*1024;
+ pThis->iPersistUpdCnt = 0; /* persist queue info every n updates */
+ pThis->bSyncQueueFiles = 0;
+ pThis->toQShutdown = 0; /* queue shutdown */
+ pThis->toActShutdown = 1000; /* action shutdown (in phase 2) */
+ pThis->toEnq = 2000; /* timeout for queue enque */
+ pThis->toWrkShutdown = 60000; /* timeout for worker thread shutdown */
+ pThis->iMinMsgsPerWrkr = 100; /* minimum messages per worker needed to start a new one */
+ pThis->bSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */
+ pThis->sizeOnDiskMax = 0; /* unlimited */
+ pThis->iDeqSlowdown = 0;
+ pThis->iDeqtWinFromHr = 0;
+ pThis->iDeqtWinToHr = 25; /* disable time-windowed dequeuing by default */
+}
+
+
/* This function checks if the provided message shall be discarded and does so, if needed.
* In DA mode, we do not discard any messages as we assume the disk subsystem is fast enough to
* provide real-time creation of spool files.