4

Following is the output from top:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 3551 mysql     20   0 10.0g  84m 4052 S  9.4  0.1 544:39.87 mysqld
 2311 root      20   0     0    0    0 R  3.1  0.0 184:36.36 kondemand/26
 2296 root      20   0     0    0    0 R  3.0  0.0 183:58.76 kondemand/11
 2297 root      20   0     0    0    0 R  3.0  0.0 183:51.36 kondemand/12
 2299 root      20   0     0    0    0 R  3.0  0.0 183:31.22 kondemand/14
 2304 root      20   0     0    0    0 R  3.0  0.0 183:57.42 kondemand/19
 2310 root      20   0     0    0    0 R  3.0  0.0 182:07.21 kondemand/25
 2312 root      20   0     0    0    0 R  3.0  0.0 184:01.70 kondemand/27
 2314 root      20   0     0    0    0 R  3.0  0.0 182:34.96 kondemand/29
 5255 root      20   0 84432  11m 2800 R  3.0  0.0  58:53.71 cPhulkd - proce
 2286 root      20   0     0    0    0 R  2.9  0.0 179:48.98 kondemand/1
 2298 root      20   0     0    0    0 R  2.9  0.0 183:01.25 kondemand/13
 2300 root      20   0     0    0    0 R  2.9  0.0 183:05.85 kondemand/15
 2302 root      20   0     0    0    0 R  2.9  0.0 181:37.64 kondemand/17
 2305 root      20   0     0    0    0 S  2.9  0.0 182:42.13 kondemand/20
 2313 root      20   0     0    0    0 S  2.9  0.0 183:37.13 kondemand/28
 3264 root      20   0  131m 6236 3712 R  2.9  0.0  13:49.84 cpsrvd (SSL) -
 2287 root      20   0     0    0    0 R  2.8  0.0 155:21.99 kondemand/2
 2289 root      20   0     0    0    0 R  2.8  0.0 181:43.40 kondemand/4
 2290 root      20   0     0    0    0 R  2.8  0.0 180:02.76 kondemand/5
 2293 root      20   0     0    0    0 R  2.8  0.0 179:04.75 kondemand/8
 2294 root      20   0     0    0    0 R  2.8  0.0 182:32.23 kondemand/9
 2295 root      20   0     0    0    0 R  2.8  0.0 184:39.21 kondemand/10
 2306 root      20   0     0    0    0 R  2.8  0.0 182:20.72 kondemand/21
 2307 root      20   0     0    0    0 R  2.8  0.0 182:39.74 kondemand/22
 2309 root      20   0     0    0    0 R  2.8  0.0 179:00.80 kondemand/24
 2315 root      20   0     0    0    0 R  2.8  0.0 182:54.88 kondemand/30
 2965 root      20   0  150m  35m 3464 R  2.8  0.1 177:45.39 httpd
 2291 root      20   0     0    0    0 R  2.7  0.0 180:53.41 kondemand/6
 2292 root      20   0     0    0    0 R  2.7  0.0 179:38.78 kondemand/7
 2303 root      20   0     0    0    0 R  2.7  0.0 184:05.13 kondemand/18
 2316 root      20   0     0    0    0 S  2.7  0.0 182:06.84 kondemand/31
18451 cuntschi  20   0  187m  12m 5608 R  2.7  0.0   0:00.29 php
 2285 root      20   0     0    0    0 R  2.6  0.0 176:55.27 kondemand/0
18430 cuntschi  20   0  186m  11m 4960 R  2.6  0.0   0:00.28 php
18445 cocksuck  20   0  175m 9332 5208 R  2.6  0.0   0:00.28 php
18459 romanced  20   0  184m   9m 4972 R  2.6  0.0   0:00.28 php
18463 sexsmovi  20   0  187m  13m 5512 R  2.6  0.0   0:00.28 php
18482 enterpri  20   0  185m  11m 5424 R  2.6  0.0   0:00.28 php
18488 enterpri  20   0  185m  12m 5456 R  2.6  0.0   0:00.28 php
 2301 root      20   0     0    0    0 R  2.5  0.0 178:52.97 kondemand/16
 2308 root      20   0     0    0    0 R  2.5  0.0 181:52.38 kondemand/23
18432 cuntschi  20   0  184m  10m 4956 R  2.5  0.0   0:00.27 php
18434 cocksuck  20   0  187m  12m 5796 R  2.5  0.0   0:00.27 php
18436 sexsmovi  20   0  186m  13m 5480 R  2.5  0.0   0:00.27 php
18439 cuntschi  20   0  184m 9868 4960 R  2.5  0.0   0:00.27 php

What is it and how do I stop it?

2
  • There is an issue with some versions of Red Hat where kondemand consumes vastly more CPU than its supposed to. – frankster Nov 26 '15 at 13:24
  • @frankster could you please provide more information? Some links to external resources that go into more detail, perhaps? – jayhendren Nov 28 '16 at 17:36
6
+25

This is automatic CPU frequency scaling. I suspect that the CPU used by it is actually idled CPU. You can test this by firing up a CPU benchmarking program. You should see the kondemand instances drop to 0% usage. The atop program will display the CPU scaling percentage as well.

Different distributions handle this differently and you didn't post yours, so I'd take a look at http://www.servernoobs.com/avoiding-cpu-speed-scaling-in-modern-linux-distributions-running-cpu-at-full-speed-tips/?doing_wp_cron=1428304535.5997378826141357421875 as a starting point. This quick script from there will universally turn it off, but you'll really want to figure out what is done in the startup scripts for your system.

for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do [ -f $CPUFREQ ] || continue; echo -n performance > $CPUFREQ; done

It's probably the case that this is doing nothing worse than saving your power. Unless you regularly have a very bursty workload, you won't stand to gain much except extra heat by disabling this (unless it's really broken in your case).

0
1

For answering your question, let us first understand what is kondemand.

kondemand is a kernel thread that belongs to the ondemand governor of cpufreq subsystem, which changes the p-states of the system, based on the utilization statistics. Thus it’s something that helps in power management. Reference on kondemand

  • Now coming to your query that why this is using CPU?

Answer : I think that you machine has 32 cores that's why there are 32 threads of kondemand threads are running. Each thread will consume a little CPU for optimizing CPU frequency. Please note that this use of CPU will be usually done at a time when CPU is idle.For that matter, kondemand is a kernel thread that relates to the cpufreq. So it is designed to save power. It shouldn't be loading up the processor during busy times.

Even if you want to disable kondemand then follow steps mentioned in below link

Above link has a wonderful explanation for the problem you have mentioned. Also you will be able to notice the impact of disabling/enabling kondemand.

There are 2 ways to disable kondemand based on your kernel version. I am not sure what version of kernel you are using. So, will have to check above link and perform the necessary action as per the kernel version installed on your system.

Best of Luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.