summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-06-09 16:38:53 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-06-09 16:38:53 +0200
commit2658319224574a54a1c76ee02b6a7f3af5dab068 (patch)
tree6b26b7e9fb3e25b0e10a9d69da0b8d70987563af
parent55e01da2ec3de1b5c6b15e4154235f0eedbb68da (diff)
downloadrsyslog-2658319224574a54a1c76ee02b6a7f3af5dab068.tar.gz
rsyslog-2658319224574a54a1c76ee02b6a7f3af5dab068.tar.xz
rsyslog-2658319224574a54a1c76ee02b6a7f3af5dab068.zip
made rsyslog tickless in the (usual and default) case that repeated
message reduction is turned off. More info: http://blog.gerhards.net/2008/06/coding-to-save-environment.html
-rw-r--r--ChangeLog3
-rw-r--r--doc/rsyslog_ng_comparison.html4
-rw-r--r--tools/syslogd.c26
3 files changed, 22 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 2cc995bd..0304f3ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@ Version 3.19.7 (rgerhards), 2008-06-??
check before sending. Credits to Martin Schuette for providing the
idea. Details are available at
http://blog.gerhards.net/2008/06/reliable-plain-tcp-syslog-once-again.html
+- made rsyslog tickless in the (usual and default) case that repeated
+ message reduction is turned off. More info:
+ http://blog.gerhards.net/2008/06/coding-to-save-environment.html
---------------------------------------------------------------------------
Version 3.19.6 (rgerhards), 2008-06-06
- enhanced property replacer to support multiple regex matches
diff --git a/doc/rsyslog_ng_comparison.html b/doc/rsyslog_ng_comparison.html
index 72fee210..600875a8 100644
--- a/doc/rsyslog_ng_comparison.html
+++ b/doc/rsyslog_ng_comparison.html
@@ -120,7 +120,7 @@ based framing on syslog/tcp connections</td>
</tr>
<tr>
<td valign="top">syslog over RELP<br>
-truly reliable message delivery (<a href="http://rgerhards.blogspot.com/2008/04/on-unreliability-of-plain-tcp-syslog.html">Why
+truly reliable message delivery (<a href="http://blog.gerhards.net/2008/05/why-you-cant-build-reliable-tcp.html">Why
is plain tcp syslog not reliable?</a>)</td>
<td valign="top">yes</td>
<td valign="top">no</td>
@@ -583,4 +583,4 @@ the mean time, you may want to read it in parallel. It is available at
<a href="http://www.balabit.com/network-security/syslog-ng/features/detailed/">Balabit's
site</a>.</p>
-</body></html> \ No newline at end of file
+</body></html>
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 8b829771..7f415f3c 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2491,15 +2491,22 @@ mainloop(void)
struct timeval tvSelectTimeout;
BEGINfunc
- while(!bFinished){
- /* first check if we have any internal messages queued and spit them out */
- /* TODO: do we need this any longer? I doubt it, but let's care about it
- * later -- rgerhards, 2007-12-21
- */
- processImInternal();
+ /* first check if we have any internal messages queued and spit them out. We used
+ * to do that on any loop iteration, but that is no longer necessry. The reason
+ * is that once we reach this point here, we always run on multiple threads and
+ * thus the main queue is properly initialized. -- rgerhards, 2008-06-09
+ */
+ processImInternal();
- /* this is now just a wait */
- tvSelectTimeout.tv_sec = TIMERINTVL;
+ while(!bFinished){
+ /* this is now just a wait - please note that we do use a near-"eternal"
+ * timeout of 1 day if we do not have repeated message reduction turned on
+ * (which it is not by default). This enables us to help safe the environment
+ * by not unnecessarily awaking rsyslog on a regular tick (just think
+ * powertop, for example). In that case, we primarily wait for a signal,
+ * but a once-a-day wakeup should be quite acceptable. -- rgerhards, 2008-06-09
+ */
+ tvSelectTimeout.tv_sec = (bReduceRepeatMsgs == 1) ? TIMERINTVL : 86400 /*1 day*/;
tvSelectTimeout.tv_usec = 0;
select(1, NULL, NULL, NULL, &tvSelectTimeout);
if(bFinished)
@@ -2526,7 +2533,8 @@ mainloop(void)
* for the time being, I think the remaining risk can be accepted.
* rgerhards, 2008-01-10
*/
- doFlushRptdMsgs();
+ if(bReducedRepeatMsgs == 1)
+ doFlushRptdMsgs();
if(restart) {
dbgprintf("\nReceived SIGHUP, reloading rsyslogd.\n");