diff --git a/conf/glances.conf b/conf/glances.conf index f50f881b..274fc79a 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -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 diff --git a/glances/config.py b/glances/config.py index 04e6a60d..de868425 100644 --- a/glances/config.py +++ b/glances/config.py @@ -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'):