Module: check_mk
Branch: master
Commit: cf3711b5a3ed89f71ddca65d7347d2e476a55439
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf3711b5a3ed89…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Dec 11 10:53:22 2017 +0100
5470 Make the number of rrdcached write threads configurable.
Thanks to Matthias Hähnel for this patch!
Change-Id: I94b5cc7c8a7575930e09b7125d974b6e6a549e54
---
.werks/5470 | 11 +++++++++++
bin/mkbench | 1 +
omd/packages/rrdtool/skel/etc/init.d/rrdcached | 4 ++--
omd/packages/rrdtool/skel/etc/rrdcached.conf | 5 +++++
web/plugins/wato/omd_configuration.py | 8 ++++++++
5 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/.werks/5470 b/.werks/5470
new file mode 100644
index 0000000..f897121
--- /dev/null
+++ b/.werks/5470
@@ -0,0 +1,11 @@
+Title: Make the number of rrdcached write threads configurable.
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cee
+Version: 1.5.0i2
+Date: 1512985932
+Class: feature
+
+
+Thanks to Matthias Hähnel for this patch!
\ No newline at end of file
diff --git a/bin/mkbench b/bin/mkbench
index ed19acf..e7f0d6d 100755
--- a/bin/mkbench
+++ b/bin/mkbench
@@ -582,6 +582,7 @@ class TestRunner(threading.Thread):
"TIMEOUT=300\n"
"RANDOM_DELAY=10\n"
"FLUSH_TIMEOUT=7200\n"
+ "WRITE_THREADS=4\n"
)
p = subprocess.Popen(["omd", "restart",
"rrdcached"],
diff --git a/omd/packages/rrdtool/skel/etc/init.d/rrdcached
b/omd/packages/rrdtool/skel/etc/init.d/rrdcached
index 174316b..9ebd4a0 100644
--- a/omd/packages/rrdtool/skel/etc/init.d/rrdcached
+++ b/omd/packages/rrdtool/skel/etc/init.d/rrdcached
@@ -22,7 +22,7 @@ fi
TIMEOUT=3600
RANDOM_DELAY=1800
FLUSH_TIMEOUT=7200
-
+WRITE_THREADS=4
# Read in tuning configuration of admin
CONFFILE=$OMD_ROOT/etc/rrdcached.conf
@@ -47,7 +47,7 @@ SOCKET="###ROOT###/tmp/run/rrdcached.sock"
PIDFILE="###ROOT###/tmp/rrdcached.pid"
USER="###SITE###"
GROUP="###SITE###"
-OPTS="-w $TIMEOUT -z $RANDOM_DELAY -f $FLUSH_TIMEOUT -s $GROUP -m 660 -l
unix:$SOCKET -p $PIDFILE -j $JOURNAL_DIR"
+OPTS="-t $WRITE_THREADS -w $TIMEOUT -z $RANDOM_DELAY -f $FLUSH_TIMEOUT -s $GROUP -m
660 -l unix:$SOCKET -p $PIDFILE -j $JOURNAL_DIR"
DAEMON="###ROOT###/bin/rrdcached"
case "$1" in
diff --git a/omd/packages/rrdtool/skel/etc/rrdcached.conf
b/omd/packages/rrdtool/skel/etc/rrdcached.conf
index f17938a..7c216e9 100644
--- a/omd/packages/rrdtool/skel/etc/rrdcached.conf
+++ b/omd/packages/rrdtool/skel/etc/rrdcached.conf
@@ -18,3 +18,8 @@ RANDOM_DELAY=1800
# 3600 seconds, is acceptable in most cases.
FLUSH_TIMEOUT=7200
+# Specifies the number of threads used for writing RRD files. Increasing this
+# number will allow rrdcached to have more simultaneous I/O requests into the
+# kernel. This may allow the kernel to re-order disk writes, resulting in better
+# disk throughput.
+WRITE_THREADS=4
diff --git a/web/plugins/wato/omd_configuration.py
b/web/plugins/wato/omd_configuration.py
index 67629fb..45556f5 100644
--- a/web/plugins/wato/omd_configuration.py
+++ b/web/plugins/wato/omd_configuration.py
@@ -479,6 +479,7 @@ class ConfigDomainRRDCached(watolib.ConfigDomain):
"TIMEOUT" :
self._get_value_from_config("TIMEOUT", int, 3600),
"RANDOM_DELAY" :
self._get_value_from_config("RANDOM_DELAY", int, 1800),
"FLUSH_TIMEOUT" :
self._get_value_from_config("FLUSH_TIMEOUT", int, 7200),
+ "WRITE_THREADS" :
self._get_value_from_config("WRITE_THREADS", int, 4),
}
}
@@ -530,6 +531,13 @@ register_configvar(group,
"acceptable in most cases."),
minvalue = 0,
)),
+ ("WRITE_THREADS", Age(
+ title = _("Number of threads used for writing RRD files"),
+ help = _("Increasing this number will allow rrdcached to have more
simultaneous "
+ "I/O requests into the kernel. This may allow the kernel to
re-order "
+ "disk writes, resulting in better disk throughput."),
+ minvalue = 1,
+ )),
],
optional_keys = [],
),