提交 46133420 编写于 作者: N Nicolargo

Improve default configuration for ctx_switches

上级 4934d78d
......@@ -25,12 +25,12 @@ steal_warning=70
steal_critical=90
#steal_log=True
# I/O wait percentage should be lower than 1/# (of CPU cores)
# Let blanck to default config (1/#-20% / 1/# / 1/#+20%)
#iowait_careful=20
#iowait_warning=25
#iowait_critical=30
# Context switch limit per core / second
# For example, if you have 2 Core, critical limit will be 28000/sec
# Let commented for default config (1/#-20% / 1/#-10% / 1/#)
#iowait_careful=30
#iowait_warning=40
#iowait_critical=50
# Context switch limit (core / second)
# Let commented for default config (critical is 56000/# (of CPU core))
ctx_switches_careful=10000
ctx_switches_warning=12000
ctx_switches_critical=14000
......
......@@ -134,8 +134,12 @@ class Config(object):
# By default I/O wait should be lower than 1/number of CPU cores
iowait_bottleneck = (1.0 / multiprocessing.cpu_count()) * 100.0
self.set_default('cpu', 'iowait_careful', str(iowait_bottleneck - (iowait_bottleneck * 0.20)))
self.set_default('cpu', 'iowait_warning', str(iowait_bottleneck))
self.set_default('cpu', 'iowait_critical', str(iowait_bottleneck + (iowait_bottleneck * 0.20)))
self.set_default('cpu', 'iowait_warning', str(iowait_bottleneck - (iowait_bottleneck * 0.10)))
self.set_default('cpu', 'iowait_critical', str(iowait_bottleneck))
ctx_switches_bottleneck = 56000 / multiprocessing.cpu_count()
self.set_default('cpu', 'ctx_switches_careful', str(ctx_switches_bottleneck - (ctx_switches_bottleneck * 0.20)))
self.set_default('cpu', 'ctx_switches_warning', str(ctx_switches_bottleneck - (ctx_switches_bottleneck * 0.10)))
self.set_default('cpu', 'ctx_switches_critical', str(ctx_switches_bottleneck))
# Per-CPU
if not self.parser.has_section('percpu'):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册