CPU usage: PS versus TOP - Different output

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat CPU usage: PS versus TOP - Different output
# 1  
Old 10-25-2009
CPU usage: PS versus TOP - Different output

CPU usage: PS versus TOP - Different output

Hi

When monitoring a Linux environment with PS command, reported CPU value for a certain process differs, sometimes greatly, from the value seen in TOP.

I understood this is not a bug, they report different data.
I can't understand the nature of this difference.

My Question: Can someone explain it in simple manner, or alternativly provide a link to such documentation.

Thanks :-)
Liav
# 2  
Old 10-25-2009
PS versus TOP at same instance or different instance !!!

If it is in different time, then it will differ because at different instance a process will occupy different percentage of it..
# 3  
Old 10-25-2009
That also interests me, only what i know is that ps reports the "actual" state of proces at the moment, top instead does some kind of summary and reports values during time
# 4  
Old 10-26-2009
1) I'm talking about the same instance at the same time. (meaning the same process id number).
2) The way I understand it NOW (from the man help) is that:
PS: reports on the accumulate CPU usage (from the time process started).
It gives some sort of an average.

TOP: reports on the CPU usage from the last time it was sampled. (E.G. if the sample
interval is 60 minutes, than it will report the CPU usage in the last 60 minutes).

My question is still open:
a) can someone point out on a good documentation about this?
b) Is there a simple command to calculate the CPU usage the
way top does it (without using top)? (top is too heavy, and if I have to filter out the
lines I need, it will be havier).

I need sort of Real Time CPU usage and not the average.

Thanks :-)
# 5  
Old 10-27-2009
Also I vote for this.... someone please clearly explain from practice view (or give good documentation) about how linux treat system resources: processes, memory, CPU usage, swap, load.... I think all of those questions should be replied together cause it is linked. I have read all what I have found, but still unclear many questions. Thanks a lot gurus
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HOWTO - Total memory and CPU usage ... without top?

Hi all, Is it possible to get total memory usage and free memory usage without top? By Googling I found for total memory usage, use vmstat, for CPU, use mpstat, for disk I/O use iostat, is this correct? Will using sar gives the same result as ALL of these three (3) commands? What about if I... (2 Replies)
Discussion started by: newbie_01
2 Replies

2. AIX

Need a list of top 10 CPU using processes (also top 10 memory hogs, separately)

Okay, I am trying to come up with a multi-platform script to report top ten CPU and memory hog processes, which will be run by our enterprise monitoring application as an auto-action item when the CPU and Memory utilization gets reported as higher than a certain threshold I use top on other... (5 Replies)
Discussion started by: thenomad
5 Replies

3. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

4. UNIX for Dummies Questions & Answers

Unix Top Command and sorting by CPU Usage

Ok, so I am using the Top command on my linux VPS to try and see the processes using the most CPU %. I hit the P to sort by CPU % but it wants to sort them from lowest to highest (ascending). My Telnet-SSH screen is only about 60 rows high so the processes with the highest CPU % usage are at the... (6 Replies)
Discussion started by: davemehta
6 Replies

5. Solaris

Multi CPU Solaris system shows 100% CPU usage.

Hello Friends, On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization. ========================================================================= $ prstat -a ... (4 Replies)
Discussion started by: mahive
4 Replies

6. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

7. UNIX for Dummies Questions & Answers

top command + %CPU usage exceeds 100%?

Hi there. I was looking at the output from running top and for short amounts of time, when I see all the process running and add up the values in the %CPU column the value exceeds 100% (I just add them quickly in my head). I assume that if I were to add up all my processes in the entire list,... (2 Replies)
Discussion started by: Carl1976
2 Replies

8. Linux

Help pinpointing high HTTPD CPU usage in TOP

Hi, new here and need some help. Sometimes my site is extremely slow, if when there aren't too many people on, whereas when there are over 300 online members the site may be very fast. We use CentOS, PHP 5.26. The server has 4GB and Plesk usually shows about 2 or 3 GB free. I believe I can see... (4 Replies)
Discussion started by: pspace
4 Replies

9. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

10. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies
Login or Register to Ask a Question