Module: check_mk
Branch: master
Commit: 087cf3627482045379fb81af3e30c7161b99cb83
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=087cf362748204…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 18 14:25:18 2017 +0200
4725 FIX Significant improvement of Check_MK check helper memory usage
The memory usage of the Check_MK check helpers, especially the growth
that occures during runtime, has been reduced significantly.
One example which has been measured in a single site with 30 Check_MK
check helpers configured and a large configuration
(a lot of hosts, services, tags and rulesets):
Before this change it was executing 1000 service checks per second with
a total memory usage of about 15 GB.
After this change it is now performing 1100 service checks per second
with a total memory usage of 3.5(!) GB.
The exact memory reduction highly depends on the Check_MK configuration,
but should be measurable in all medium to large environments.
Change-Id: I42e2a6f9da071b0a5f302bb41d7ae1db973fccc3
---
.werks/4725 | 24 ++++++++++++++++++++++++
cmk_base/rulesets.py | 11 -----------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/.werks/4725 b/.werks/4725
new file mode 100644
index 0000000..ca51887
--- /dev/null
+++ b/.werks/4725
@@ -0,0 +1,24 @@
+Title: Significant improvement of Check_MK check helper memory usage
+Level: 2
+Component: core
+Compatible: compat
+Edition: cee
+Version: 1.5.0i1
+Date: 1495108890
+Class: fix
+
+The memory usage of the Check_MK check helpers, especially the growth
+that occures during runtime, has been reduced significantly.
+
+One example which has been measured in a single site with 30 Check_MK
+check helpers configured and a large configuration
+(a lot of hosts, services, tags and rulesets):
+
+Before this change it was executing 1000 service checks per second with
+a total memory usage of about 15 GB.
+
+After this change it is now performing 1100 service checks per second
+with a total memory usage of 3.5(!) GB.
+
+The exact memory reduction highly depends on the Check_MK configuration,
+but should be measurable in all medium to large environments.
diff --git a/cmk_base/rulesets.py b/cmk_base/rulesets.py
index 10536c4..ee5b762 100644
--- a/cmk_base/rulesets.py
+++ b/cmk_base/rulesets.py
@@ -61,15 +61,6 @@ def get_rule_options(entry):
# for those negated with '!'. Those the host must *not* have!
# New in 1.1.13: a trailing + means a prefix match
def hosttags_match_taglist(hosttags, required_tags):
- cache = cmk_base.config_cache.get_dict("hosttags_match_taglist")
-
- cache_id = tuple(hosttags), tuple(required_tags)
-
- try:
- return cache[cache_id]
- except KeyError:
- pass
-
for tag in required_tags:
negate, tag = parse_negated(tag)
if tag and tag[-1] == '+':
@@ -84,10 +75,8 @@ def hosttags_match_taglist(hosttags, required_tags):
matches = tag in hosttags
if matches == negate:
- cache[cache_id] = False
return False
- cache[cache_id] = True
return True