ubure
07-11-2003, 07:27
Ho notato che su una macchina linux, apparentemente scarica di
processi che impegnino significativamente la CPU il "load average" ritornato
dal comando top risulta essere permanentemente appena sopra 1.
Dalla pagina di man getloadavg ho capito che il load average corrisponde al
numero di processi nella "system run queue".
Mi pare anche di capire che un processo puo' rimanere nella "system run queue"
perche' e' in attesa di qualcosa che non avviene, senza necessariamente
impegnare la CPU.
La domanda e': come identificare il processo in questione tra tutti i processi
attivi?
Da notare che su un'altra macchina perfettamente identica e nelle stesse
condizioni il fenomeno non si osserva.
Nel seguito riporto il listato del comando top su entrambe le macchine.
Primo listato di top sulla macchina con load average: >1 :
===========================================
9:36am up 9 days, 16:42, 0 users, load average: 1.06, 1.04, 1.01
52 processes: 51 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 1.8% user, 0.6% system, 0.4% nice, 4.6% idle
Mem: 1289824K av, 1244388K used, 45436K free, 0K shrd, 31472K buff
Swap: 2096440K av, 5896K used, 2090544K free 370468K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1 root 8 0 112 68 56 S 0.0 0.0 0:03 init
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
4 root 9 0 0 0 0 SW 0.0 0.0 0:05 kswapd
5 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
6 root 9 0 0 0 0 SW 0.0 0.0 0:00 kupdated
7 root -1 -20 0 0 0 SW< 0.0 0.0 0:00 mdrecoveryd
8 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
9 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMfs_main_serve
11 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMFS_gc
10 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_migd
12 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_infoD
13 root 9 0 0 0 0 SW 0.0 0.0 0:00 memsorter
81 root 9 0 0 0 0 SW 0.0 0.0 0:00 khubd
178 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
179 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
668 root 9 0 396 388 352 S 0.0 0.0 0:00 syslogd
673 root 9 0 196 180 180 S 0.0 0.0 0:00 klogd
693 rpc 9 0 372 360 356 S 0.0 0.0 0:00 portmap
721 rpcuser 9 0 96 4 4 S 0.0 0.0 0:00 rpc.statd
864 root 8 0 608 528 484 S 0.0 0.0 0:00 sshd
897 root 15 0 564 444 404 S 0.0 0.0 0:00 xinetd
933 root 9 0 0 0 0 SW 0.0 0.0 0:03 afs_rxlistener
934 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_callback
936 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_rxevent
938 root 9 0 0 0 0 SW 0.0 0.0 0:00 afsd
942 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_checkserver
943 root 9 0 0 0 0 SW 0.0 0.0 0:02 afs_background
944 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
946 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
948 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_cachetrim
978 root 9 0 116 68 68 S 0.0 0.0 0:00 gpm
996 root 9 0 164 124 88 S 0.0 0.0 0:00 crond
1050 root 9 0 2380 48 28 S 0.0 0.0 0:00 xfs
1086 daemon 9 0 456 404 404 S 0.0 0.0 0:00 atd
1154 root -1 -20 1200 1088 756 S < 0.0 0.0 0:00 res
1156 root 9 0 1552 1396 1068 S 0.0 0.1 0:00 sbatchd
1167 root 9 0 2584 600 336 S 0.0 0.0 0:00 miniserv.pl
1171 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1172 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1173 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1174 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1175 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1176 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
8176 lsf -1 -20 528 528 436 S < 0.0 0.0 0:00 eauth
12041 root -1 -20 1292 1236 936 S < 0.0 0.0 0:00 lim
12042 root 10 -20 1144 1144 960 S < 0.0 0.0 0:14 elim
12043 root 9 0 716 660 544 S 0.0 0.0 0:00 pim
20746 root 11 -20 652 652 568 S < 0.0 0.0 0:00 sleep
20747 root 17 0 1032 1032 820 S 0.0 0.0 0:00 in.rshd
20748 bracco 19 0 464 464 392 S 0.0 0.0 0:00 ksh
20749 bracco 18 0 892 892 716 R 0.0 0.0 0:00 top
Secondo listato di top sulla macchina con load average zero:
=============================================
9:49am up 9 days, 16:54, 0 users, load average: 0.00, 0.00, 0.00
52 processes: 51 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 0.8% user, 0.6% system, 0.4% nice, 0.6% idle
Mem: 1289824K av, 1108348K used, 181476K free, 0K shrd, 35344K buff
Swap: 2096440K av, 5864K used, 2090576K free 242648K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1 root 8 0 224 180 164 S 0.0 0.0 0:03 init
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
4 root 9 0 0 0 0 SW 0.0 0.0 0:07 kswapd
5 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
6 root 9 0 0 0 0 SW 0.0 0.0 0:00 kupdated
7 root -1 -20 0 0 0 SW< 0.0 0.0 0:00 mdrecoveryd
8 root 10 0 0 0 0 SW 0.0 0.0 0:00 kjournald
9 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMfs_main_serve
11 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMFS_gc
10 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_migd
12 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_infoD
13 root 9 0 0 0 0 SW 0.0 0.0 0:00 memsorter
81 root 9 0 0 0 0 SW 0.0 0.0 0:00 khubd
178 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
179 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
665 root 9 0 396 388 352 S 0.0 0.0 0:00 syslogd
670 root 9 0 196 180 180 S 0.0 0.0 0:00 klogd
690 rpc 9 0 372 360 356 S 0.0 0.0 0:00 portmap
718 rpcuser 9 0 96 4 4 S 0.0 0.0 0:00 rpc.statd
861 root 8 0 608 528 484 S 0.0 0.0 0:00 sshd
894 root 15 0 564 444 404 S 0.0 0.0 0:00 xinetd
931 root 9 0 0 0 0 SW 0.0 0.0 0:03 afs_rxlistener
932 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_callback
933 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_rxevent
935 root 9 0 0 0 0 SW 0.0 0.0 0:00 afsd
939 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_checkserver
940 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
941 root 9 0 0 0 0 SW 0.0 0.0 0:02 afs_background
943 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
945 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_cachetrim
975 root 9 0 116 68 68 S 0.0 0.0 0:00 gpm
993 root 9 0 164 124 88 S 0.0 0.0 0:00 crond
1047 root 9 0 2380 48 28 S 0.0 0.0 0:00 xfs
1083 daemon 9 0 456 404 404 S 0.0 0.0 0:00 atd
1151 root -1 -20 1316 1224 752 S < 0.0 0.0 0:00 res
1153 root 8 0 1576 1416 1048 S 0.0 0.1 0:00 sbatchd
1164 root 9 0 2584 600 344 S 0.0 0.0 0:00 miniserv.pl
1168 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1169 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1170 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1171 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1172 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1173 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
32145 lsf -1 -20 528 528 436 S < 0.0 0.0 0:00 eauth
5158 root -1 -20 1292 1236 936 S < 0.0 0.0 0:00 lim
5159 root 10 -20 1144 1144 960 S < 0.0 0.0 0:08 elim
5160 root 9 0 716 660 544 S 0.0 0.0 0:00 pim
20800 root 11 -20 652 652 568 S < 0.0 0.0 0:00 sleep
20801 root 18 0 1032 1032 820 S 0.0 0.0 0:00 in.rshd
20802 bracco 19 0 464 464 392 S 0.0 0.0 0:00 ksh
20803 bracco 19 0 892 892 716 R 0.0 0.0 0:00 top
processi che impegnino significativamente la CPU il "load average" ritornato
dal comando top risulta essere permanentemente appena sopra 1.
Dalla pagina di man getloadavg ho capito che il load average corrisponde al
numero di processi nella "system run queue".
Mi pare anche di capire che un processo puo' rimanere nella "system run queue"
perche' e' in attesa di qualcosa che non avviene, senza necessariamente
impegnare la CPU.
La domanda e': come identificare il processo in questione tra tutti i processi
attivi?
Da notare che su un'altra macchina perfettamente identica e nelle stesse
condizioni il fenomeno non si osserva.
Nel seguito riporto il listato del comando top su entrambe le macchine.
Primo listato di top sulla macchina con load average: >1 :
===========================================
9:36am up 9 days, 16:42, 0 users, load average: 1.06, 1.04, 1.01
52 processes: 51 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 1.8% user, 0.6% system, 0.4% nice, 4.6% idle
Mem: 1289824K av, 1244388K used, 45436K free, 0K shrd, 31472K buff
Swap: 2096440K av, 5896K used, 2090544K free 370468K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1 root 8 0 112 68 56 S 0.0 0.0 0:03 init
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
4 root 9 0 0 0 0 SW 0.0 0.0 0:05 kswapd
5 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
6 root 9 0 0 0 0 SW 0.0 0.0 0:00 kupdated
7 root -1 -20 0 0 0 SW< 0.0 0.0 0:00 mdrecoveryd
8 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
9 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMfs_main_serve
11 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMFS_gc
10 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_migd
12 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_infoD
13 root 9 0 0 0 0 SW 0.0 0.0 0:00 memsorter
81 root 9 0 0 0 0 SW 0.0 0.0 0:00 khubd
178 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
179 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
668 root 9 0 396 388 352 S 0.0 0.0 0:00 syslogd
673 root 9 0 196 180 180 S 0.0 0.0 0:00 klogd
693 rpc 9 0 372 360 356 S 0.0 0.0 0:00 portmap
721 rpcuser 9 0 96 4 4 S 0.0 0.0 0:00 rpc.statd
864 root 8 0 608 528 484 S 0.0 0.0 0:00 sshd
897 root 15 0 564 444 404 S 0.0 0.0 0:00 xinetd
933 root 9 0 0 0 0 SW 0.0 0.0 0:03 afs_rxlistener
934 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_callback
936 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_rxevent
938 root 9 0 0 0 0 SW 0.0 0.0 0:00 afsd
942 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_checkserver
943 root 9 0 0 0 0 SW 0.0 0.0 0:02 afs_background
944 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
946 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
948 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_cachetrim
978 root 9 0 116 68 68 S 0.0 0.0 0:00 gpm
996 root 9 0 164 124 88 S 0.0 0.0 0:00 crond
1050 root 9 0 2380 48 28 S 0.0 0.0 0:00 xfs
1086 daemon 9 0 456 404 404 S 0.0 0.0 0:00 atd
1154 root -1 -20 1200 1088 756 S < 0.0 0.0 0:00 res
1156 root 9 0 1552 1396 1068 S 0.0 0.1 0:00 sbatchd
1167 root 9 0 2584 600 336 S 0.0 0.0 0:00 miniserv.pl
1171 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1172 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1173 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1174 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1175 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
1176 root 9 0 88 36 36 S 0.0 0.0 0:00 mingetty
8176 lsf -1 -20 528 528 436 S < 0.0 0.0 0:00 eauth
12041 root -1 -20 1292 1236 936 S < 0.0 0.0 0:00 lim
12042 root 10 -20 1144 1144 960 S < 0.0 0.0 0:14 elim
12043 root 9 0 716 660 544 S 0.0 0.0 0:00 pim
20746 root 11 -20 652 652 568 S < 0.0 0.0 0:00 sleep
20747 root 17 0 1032 1032 820 S 0.0 0.0 0:00 in.rshd
20748 bracco 19 0 464 464 392 S 0.0 0.0 0:00 ksh
20749 bracco 18 0 892 892 716 R 0.0 0.0 0:00 top
Secondo listato di top sulla macchina con load average zero:
=============================================
9:49am up 9 days, 16:54, 0 users, load average: 0.00, 0.00, 0.00
52 processes: 51 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 0.8% user, 0.6% system, 0.4% nice, 0.6% idle
Mem: 1289824K av, 1108348K used, 181476K free, 0K shrd, 35344K buff
Swap: 2096440K av, 5864K used, 2090576K free 242648K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1 root 8 0 224 180 164 S 0.0 0.0 0:03 init
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
4 root 9 0 0 0 0 SW 0.0 0.0 0:07 kswapd
5 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
6 root 9 0 0 0 0 SW 0.0 0.0 0:00 kupdated
7 root -1 -20 0 0 0 SW< 0.0 0.0 0:00 mdrecoveryd
8 root 10 0 0 0 0 SW 0.0 0.0 0:00 kjournald
9 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMfs_main_serve
11 root 9 0 0 0 0 SW 0.0 0.0 0:00 oMFS_gc
10 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_migd
12 root 9 0 0 0 0 SW 0.0 0.0 0:00 oM_infoD
13 root 9 0 0 0 0 SW 0.0 0.0 0:00 memsorter
81 root 9 0 0 0 0 SW 0.0 0.0 0:00 khubd
178 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
179 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
665 root 9 0 396 388 352 S 0.0 0.0 0:00 syslogd
670 root 9 0 196 180 180 S 0.0 0.0 0:00 klogd
690 rpc 9 0 372 360 356 S 0.0 0.0 0:00 portmap
718 rpcuser 9 0 96 4 4 S 0.0 0.0 0:00 rpc.statd
861 root 8 0 608 528 484 S 0.0 0.0 0:00 sshd
894 root 15 0 564 444 404 S 0.0 0.0 0:00 xinetd
931 root 9 0 0 0 0 SW 0.0 0.0 0:03 afs_rxlistener
932 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_callback
933 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_rxevent
935 root 9 0 0 0 0 SW 0.0 0.0 0:00 afsd
939 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_checkserver
940 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
941 root 9 0 0 0 0 SW 0.0 0.0 0:02 afs_background
943 root 9 0 0 0 0 SW 0.0 0.0 0:01 afs_background
945 root 9 0 0 0 0 SW 0.0 0.0 0:00 afs_cachetrim
975 root 9 0 116 68 68 S 0.0 0.0 0:00 gpm
993 root 9 0 164 124 88 S 0.0 0.0 0:00 crond
1047 root 9 0 2380 48 28 S 0.0 0.0 0:00 xfs
1083 daemon 9 0 456 404 404 S 0.0 0.0 0:00 atd
1151 root -1 -20 1316 1224 752 S < 0.0 0.0 0:00 res
1153 root 8 0 1576 1416 1048 S 0.0 0.1 0:00 sbatchd
1164 root 9 0 2584 600 344 S 0.0 0.0 0:00 miniserv.pl
1168 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1169 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1170 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1171 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1172 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
1173 root 9 0 156 104 104 S 0.0 0.0 0:00 mingetty
32145 lsf -1 -20 528 528 436 S < 0.0 0.0 0:00 eauth
5158 root -1 -20 1292 1236 936 S < 0.0 0.0 0:00 lim
5159 root 10 -20 1144 1144 960 S < 0.0 0.0 0:08 elim
5160 root 9 0 716 660 544 S 0.0 0.0 0:00 pim
20800 root 11 -20 652 652 568 S < 0.0 0.0 0:00 sleep
20801 root 18 0 1032 1032 820 S 0.0 0.0 0:00 in.rshd
20802 bracco 19 0 464 464 392 S 0.0 0.0 0:00 ksh
20803 bracco 19 0 892 892 716 R 0.0 0.0 0:00 top