I have four scripts running in my single-core server which in total execute 30
As seen above,
If I compare the
What might cause high CPU utilization observed by average load values while there are no processes in
snmpset
commands in each second and 4 snmpget
commands in each second. Once I start those scripts, the server becomes slow and after five minutes the load average is almost 5:
Code:
[s@ ~]$ for i in {1..10}; do top -b -S -C 10; sleep 1; done
last pid: 27453; load averages: 4.99, 3.72, 2.35 up 158+23:45:09 16:08:50
219 processes: 7 running, 195 sleeping, 17 waiting
Mem: 366M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 62M Free
Swap: 1996M Total, 218M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 4.69% idle
15836 root 1 44 0 323M 298M select 128:14 1.17% Xorg
27443 s 1 73 0 6680K 3408K RUN 0:00 0.78% snmpset
27448 s 1 72 0 6680K 3200K RUN 0:00 0.78% snmpget
27445 s 1 72 0 5656K 2936K RUN 0:00 0.49% snmpget
27451 s 1 69 0 5656K 2536K RUN 0:00 0.29% snmpget
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
3 root 1 -8 - 0K 8K - 28:17 0.00% g_up
last pid: 27459; load averages: 4.91, 3.72, 2.36 up 158+23:45:10 16:08:51
215 processes: 7 running, 191 sleeping, 17 waiting
Mem: 368M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 60M Free
Swap: 1996M Total, 218M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 4.05% idle
27451 s 1 96 0 8728K 5208K RUN 0:00 1.66% snmpget
15836 root 1 44 0 323M 298M select 128:14 0.98% Xorg
27456 s 1 96 0 6680K 3444K RUN 0:00 0.78% snmpset
27458 s 1 96 0 6680K 3192K RUN 0:00 0.59% snmpset
27457 s 1 96 0 5656K 2788K RUN 0:00 0.49% snmpset
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
3 root 1 -8 - 0K 8K - 28:17 0.00% g_up
last pid: 27469; load averages: 4.91, 3.72, 2.36 up 158+23:45:11 16:08:52
215 processes: 7 running, 191 sleeping, 17 waiting
Mem: 374M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 54M Free
Swap: 1996M Total, 218M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 3.76% idle
27467 s 1 96 0 8728K 5020K RUN 0:00 1.86% snmpget
27461 s 1 96 0 8728K 5040K RUN 0:00 1.86% snmpset
27465 s 1 76 0 8728K 5188K RUN 0:00 1.76% snmpset
27456 s 1 76 0 8728K 5188K RUN 0:00 1.56% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.88% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
3 root 1 -8 - 0K 8K - 28:17 0.00% g_up
last pid: 27479; load averages: 4.91, 3.72, 2.36 up 158+23:45:12 16:08:53
215 processes: 8 running, 190 sleeping, 17 waiting
Mem: 376M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 52M Free
Swap: 1996M Total, 218M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 3.37% idle
27477 s 1 76 0 8728K 5188K RUN 0:00 1.86% snmpset
27474 s 1 76 0 8728K 5188K RUN 0:00 1.66% snmpset
27462 s 1 96 0 8728K 5216K RUN 0:00 1.66% snmpset
27467 s 1 96 0 8728K 5208K RUN 0:00 1.56% snmpget
27478 s 1 96 0 7704K 4196K RUN 0:00 1.37% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.68% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
last pid: 27486; load averages: 4.91, 3.72, 2.36 up 158+23:45:13 16:08:54
213 processes: 7 running, 189 sleeping, 17 waiting
Mem: 376M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 53M Free
Swap: 1996M Total, 218M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 2.98% idle
27482 s 1 76 0 8728K 5188K RUN 0:00 1.86% snmpset
27481 s 1 76 0 8728K 5188K RUN 0:00 1.86% snmpset
27485 s 1 96 0 8728K 5180K RUN 0:00 1.66% snmpset
27483 s 1 76 0 8728K 5188K RUN 0:00 1.66% snmpset
27484 s 1 96 0 6680K 3492K RUN 0:00 0.98% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.78% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
last pid: 27496; load averages: 4.91, 3.72, 2.36 up 158+23:45:14 16:08:55
213 processes: 7 running, 189 sleeping, 17 waiting
Mem: 372M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 57M Free
Swap: 1996M Total, 217M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 2.59% idle
27493 s 1 76 0 8728K 5188K RUN 0:00 1.76% snmpset
27489 s 1 76 0 8728K 5188K RUN 0:00 1.66% snmpset
27494 s 1 96 0 6680K 3428K RUN 0:00 0.98% snmpset
27490 s 1 96 0 6680K 3540K RUN 0:00 0.88% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.78% Xorg
27495 s 1 96 0 5656K 2800K RUN 0:00 0.39% snmpset
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
last pid: 27502; load averages: 4.91, 3.74, 2.37 up 158+23:45:15 16:08:56
213 processes: 7 running, 189 sleeping, 17 waiting
Mem: 375M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 54M Free
Swap: 1996M Total, 217M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 2.29% idle
27495 s 1 96 0 8728K 5044K RUN 0:00 1.66% snmpset
27499 s 1 76 0 8728K 5188K RUN 0:00 1.66% snmpset
27500 s 1 76 0 8728K 5188K RUN 0:00 1.66% snmpset
27498 s 1 96 0 7704K 4040K RUN 0:00 1.07% snmpset
27501 s 1 96 0 6680K 3444K RUN 0:00 0.98% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.68% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
last pid: 27509; load averages: 4.91, 3.74, 2.37 up 158+23:45:16 16:08:57
213 processes: 7 running, 189 sleeping, 17 waiting
Mem: 374M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 55M Free
Swap: 1996M Total, 217M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 1.95% idle
27506 s 1 96 0 8728K 5008K RUN 0:00 1.76% snmpset
27501 s 1 76 0 8728K 5188K RUN 0:00 1.56% snmpset
27504 s 1 96 0 8728K 5028K RUN 0:00 1.56% snmpset
27507 s 1 96 0 6680K 3500K RUN 0:00 0.98% snmpset
27508 s 1 96 0 6680K 3428K RUN 0:00 0.78% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.49% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
last pid: 27518; load averages: 4.91, 3.74, 2.37 up 158+23:45:17 16:08:58
213 processes: 6 running, 190 sleeping, 17 waiting
Mem: 367M Active, 213M Inact, 320M Wired, 21M Cache, 110M Buf, 62M Free
Swap: 1996M Total, 217M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 1.76% idle
27514 s 1 96 0 6680K 3624K RUN 0:00 1.07% snmpset
27516 s 1 96 0 6680K 3568K RUN 0:00 1.07% snmpset
27515 s 1 96 0 6680K 3540K RUN 0:00 0.88% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.59% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
3 root 1 -8 - 0K 8K - 28:17 0.00% g_up
33044 s 6 44 0 226M 198M ucond 27:57 0.00% firefox-bin
last pid: 27526; load averages: 4.91, 3.74, 2.37 up 158+23:45:18 16:08:59
215 processes: 7 running, 191 sleeping, 17 waiting
Mem: 373M Active, 213M Inact, 321M Wired, 21M Cache, 110M Buf, 56M Free
Swap: 1996M Total, 217M Used, 1778M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
27521 s 1 76 0 8728K 5180K RUN 0:00 1.76% snmpget
27517 s 1 96 0 8728K 5040K RUN 0:00 1.56% snmpset
11 root 1 171 ki31 0K 8K RUN 2873.4 1.46% idle
27525 s 1 96 0 6680K 3540K RUN 0:00 1.07% snmpset
27524 s 1 96 0 6680K 3472K RUN 0:00 0.88% snmpset
27523 s 1 96 0 6680K 3444K RUN 0:00 0.78% snmpset
15836 root 1 44 0 323M 298M select 128:14 0.59% Xorg
12 root 17 -60 - 0K 136K WAIT 468:54 0.00% intr
17 root 1 44 - 0K 8K syncer 168:30 0.00% syncer
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
[s@ ~]$
As seen above,
top
command is in "raw CPU" mode which means that it shows the utilization of a process for sample interval (1 second). However, the overall utilization seen in the CPU column is fairly low.If I compare the
top
output above with top
output at the time when scripts do not run, then the idle
process has lot more CPU-time:
Code:
last pid: 23983; load averages: 0.74, 0.88, 1.01 up 158+23:37:40 16:01:21
207 processes: 2 running, 188 sleeping, 17 waiting
Mem: 359M Active, 212M Inact, 320M Wired, 21M Cache, 110M Buf, 71M Free
Swap: 1996M Total, 219M Used, 1777M Free, 10% Inuse
PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
11 root 1 171 ki31 0K 8K RUN 2873.4 50.98% idle
12 root 17 -60 - 0K 136K WAIT 468:53 0.20% intr
17 root 1 44 - 0K 8K syncer 168:29 0.10% syncer
15836 root 1 44 0 323M 298M select 127:59 0.00% Xorg
1234 root 1 44 0 3804K 1028K select 53:01 0.00% hald-addon-storage
3 root 1 -8 - 0K 8K - 28:17 0.00% g_up
33044 s 7 44 0 227M 199M ucond 27:43 0.00% firefox-bin
1204 haldaemon 1 44 0 7236K 1868K select 25:23 0.00% hald
4 root 1 -8 - 0K 8K - 24:52 0.00% g_down
13 root 1 -16 - 0K 8K - 21:00 0.00% yarrow
What might cause high CPU utilization observed by average load values while there are no processes in
top
output which load the CPU? Packet interrupts?