summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 055e37f)
raw | patch | inline | side by side (parent: 055e37f)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Mon, 17 Jul 2017 05:26:16 +0000 (12:26 +0700) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 20 Jul 2017 05:56:11 +0000 (07:56 +0200) |
The CacheFlush implementation does not respect RandomTimeout value.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
src/collectd.conf.pod | patch | blob | history | |
src/rrdtool.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 27acc9974ea7cf8eac852da1ed7c001966fd7ed4..f94669ada70fd77a3f8b8f57822d029592928306 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -6469,12 +6469,12 @@ it writes all values for a certain RRD-file if the oldest value is older than
(or equal to) the number of seconds specified by B<CacheTimeout>.
That check happens on new values arriwal. If some RRD-file is not updated
anymore for some reason (the computer was shut down, the network is broken,
-etc.) some values may still be in the cache. If B<CacheFlush> is set, then the
-entire cache is searched for entries older than B<CacheTimeout> seconds and
-written to disk every I<Seconds> seconds. Since this is kind of expensive and
-does nothing under normal circumstances, this value should not be too small.
-900 seconds might be a good value, though setting this to 7200 seconds doesn't
-normally do much harm either.
+etc.) some values may still be in the cache. If B<CacheFlush> is set, then
+every I<Seconds> seconds the entire cache is searched for entries older than
+B<CacheTimeout> + B<RandomTimeout> seconds. The entries found are written to
+disk. Since entire cache scan is kind of expensive and does nothing under normal
+circumstances, this value should not be too small. 900 seconds might be a good
+value, though setting this to 7200 seconds doesn't normally do much harm either.
Default value for this option is 10x of B<CacheTimeout>.
If value of B<CacheFlush> less than value of B<CacheTimeout> then default value
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 0f02ffc2e47d5fd4147d8c93c864c3fd12dfffde..dd2df0fe422d62d16ab5f16f29a344f9e132e45c 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
if ((cache_timeout > 0) &&
((cdtime() - cache_flush_last) > cache_flush_timeout))
- rrd_cache_flush(cache_timeout);
+ rrd_cache_flush(cache_timeout + random_timeout);
pthread_mutex_unlock(&cache_lock);