1754964 Members
3105 Online
108828 Solutions
New Discussion

Re: dubt on Top Command

 
SOLVED
Go to solution
alessandro_37
Advisor

dubt on Top Command

Dear all,
i have one dubt on top command.
#top
...
...

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 26052 dante 154 22 30344K 1368K sleep 0:04 4.96 4.96 oracledante
0 ? 18760 oracle 148 20 29896K 204K sleep 997:14 2.37 2.36 ora_i201_da
0 ? 43 root 152 20 0K 0K run 221:48 1.29 1.29 vxfsd
0 ? 25131 dante 154 20 31864K 2852K

How is possible that if a process in in "sleep" states, it uses 4.96% of CPU?

example: (from top command)
...
..
RES STATE TIME %WCPU %CPU COMMAND
1368K sleep 0:04 4.96 4.96 oracledante

Thanks a lot Alessandro




1 REPLY 1
Sridhar Bhaskarla
Honored Contributor
Solution

Re: dubt on Top Command

HI Alessandro,

It's only a snapshot of the state of the processes at that time. If a process sleeps (waiting for disk, network etc.,) more frequently then the probability of seeing it in sleep state is more which doesn't mean that process was sleeping all the time. Between two intervals of collection by top, it might have consumed some CPU cycles.

To really see how sleep alone consumes the cpu, do 'sleep 240&' and run top. Browse the screen by typing 'j' until you get to your command. You should see almost 0.0 utilization related to your sleep process.
-Sri
You may be disappointed if you fail, but you are doomed if you don't try