系统相关
首页 > 系统相关> > linux – Kondemand进程占用了我的大部分CPU

linux – Kondemand进程占用了我的大部分CPU

作者:互联网

以下是顶部的输出:

  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

它是什么以及如何阻止它?

解决方法:

这是自动CPU频率缩放.我怀疑它使用的CPU实际上是闲置的CPU.您可以通过启动CPU基准测试程序来测试它.您应该看到kondemand实例的使用率降至0%. atop程序也将显示CPU缩放百分比.

不同的发行版处理方式不同而你没有发布你的发行版,因此我将以http://www.servernoobs.com/avoiding-cpu-speed-scaling-in-modern-linux-distributions-running-cpu-at-full-speed-tips/?doing_wp_cron=1428304535.5997378826141357421875作为起点.这个快速的脚本将普遍关闭,但你真的想弄清楚你的系统的启动脚本做了什么.

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

可能的情况是,这比没有节省电力更糟糕.除非你经常有非常大的工作量,否则你不会因为禁用额外的热量而获得更多的收益(除非在你的情况下真的被打破).

标签:linux,cpu,cpu-frequency
来源: https://codeday.me/bug/20190814/1652322.html