Difference between ps output and top output?

Posted by Soumya Prasad Ukil on Super User See other posts from Super User or by Soumya Prasad Ukil
Published on 2012-07-20T08:04:31Z Indexed on 2012/09/12 9:41 UTC
Read the original article Hit count: 229

Filed under:

I find it difficult to understand the output produced by ps and top?

This is the output by top:

PID    PSID USERNAME  TID  PRI NICE  SIZE  RES  STATE  TIME    CPU   COMMAND
26439 23712 soumyau  26439  15    0 7512M 5234M sleep 286:25  16.67% or_lse2 (18)
26523 23712 soumyau  26439  -2    0 7512M 5234M cpu9  143:10   8.33% or_lse2
26522 23712 soumyau  26439  -2    0 7512M 5234M cpu3  143:10   8.33% or_lse2

This is by ps (ps -L -p 26439 -o pcpu,psr,pid,user,tid):

%CPU  PSR   PID   USER       TID
99.9   3   26439 soumyau    26522
99.9   9   26439 soumyau    26523
0.0    8   26439 soumyau    26439

Why are there differences in two result?

Can you briefly explain the significance of the two CPU% ?

© Super User or respective owner

Related posts about linux