Hola: Estoy un poco confundido con el significado de %CPU reportado por top. La siguiente es la definicion del manual:
k: %CPU -- CPU usage The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if 'Irix mode' is Off, top will operate in 'Solaris mode' where a task's cpu usage will be divided by the total number of CPUs. You toggle 'Irix/Solaris' modes with the 'I' interactive command. Y esta es una captura de top Tasks: 128 total, 2 running, 126 sleeping, 0 stopped, 0 zombie Cpu(s): 13.5%us, 1.8%sy, 0.0%ni, 84.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 2062952k total, 934044k used, 1128908k free, 29032k buffers Swap: 2008084k total, 0k used, 2008084k free, 335764k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10030 ajw 20 0 67632 23m 7360 S 22 1.2 0:09.54 python 5322 root 20 0 293m 27m 8436 S 6 1.4 2:40.33 Xorg 5934 ajw 20 0 249m 127m 26m S 2 6.3 2:58.27 firefox 4914 avahi 20 0 3404 1960 1244 S 1 0.1 0:08.06 avahi-daemon 5819 ajw 20 0 21232 8424 6944 R 1 0.4 0:21.72 multiload-apple 1 root 20 0 3056 1884 564 S 0 0.1 0:01.24 init Como ven, aparece Cpu(s): 13.5%us, y para el proceso 10030 (python), aparece %CPU 22. Segun la definicion del manual, entiendo que en los ultimos 3 segundos (periodo de actualizacion de top), el 13.5% del periodo fue usado por la CPU por programas de usuario, y de ese 13.5%, el 22% fue usado por python. Sin embargo mi interpretacion no cuadra, porque la suma de todos los procesos no suma 100, sino 32. Es posible que el 68% faltante este repartido entre los otros procesos, y que aparezca como 0 porque fue truncado? Hay otra explicacion? El tener dos nucleos afecta en algo? Saludos, Alejandro.