- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Process and CPU information
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 01:39 AM
12-30-2009 01:39 AM
Following command, prints the unique values of CPU numbers.
ps -ef|awk '{print $4}'|sort -r |uniq
C
3
20
2
12
1
0
In my system, I have CPU0, CPU1, CPU2, CPU4, CPU6 and CPU7.
I don't uderstand the CPU numbers 20,12,3 which are not present in my system.
Could you please explain about this?
Ravi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 03:25 AM
12-30-2009 03:25 AM
Re: Process and CPU information
C isn't the number of cpu's.
%cpu %CPU cpu utilization of the process in "##.#" format.
Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. It will not add up to 100% unless you are lucky. (alias pcpu).
Rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 03:38 AM
12-30-2009 03:38 AM
Re: Process and CPU information
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 03:43 AM
12-30-2009 03:43 AM
Re: Process and CPU information
pcpu
The percentage of CPU time used by this process during the last scheduling interval. The default heading for this column is %CPU.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 07:28 AM
12-30-2009 07:28 AM
Re: Process and CPU information
No need to use uniq(1) here, you can use: ... | sort -r -u
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 08:12 AM
12-30-2009 08:12 AM
Re: Process and CPU information
I am sorry, I could have presented my question in more approprite way. Even it is my understanding that CPU cloumn would show the CPU number, instead of number of CPU's.
In my system, I have CPU0, CPU1, CPU2, CPU4, CPU6 and CPU7. In that case, ps -ef o/p shoudl have 0,1,2,4,6 and 7. Please correct me if I am wrong.
Apart from that, I see 20, 12 and 3 numbers in CPU column.
I have little knowledge about pcpu, but I am interested in the CPU cloumn.
Cheers,
Ravi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 08:16 AM
12-30-2009 08:16 AM
Re: Process and CPU information
That is wrong. The CPU column shows processor utilization not processor number.
>Please correct me if I am wrong.
You are wrong (see above).
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 08:51 AM
12-30-2009 08:51 AM
Re: Process and CPU information
Are you thinking of the CPU number in the top(1) output?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 10:34 AM
12-30-2009 10:34 AM
Re: Process and CPU information
Out of 6 CPU's, if 2 CPU's utilization is above 90% (as per OVPA reports), how do I know which processes are keeping those 2 CPU's busy.
Can you please help me?
Ravi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2009 11:02 AM
12-30-2009 11:02 AM
SolutionDoesn't top(1) tell you which process is busy and using which CPU? (Provided you aren't using threads.)
Any reason you care?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2010 12:36 AM
01-02-2010 12:36 AM
Re: Process and CPU information
you are correct, top gives me the data I am looking for. I almost forgot the handy tools that we have in unix. I have been using the following command to get top 20 CPU consuming processes.
UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk2 | head -20
If I look at TIME in top man page it says teh following.
TIME Number of system and CPU seconds the process has consumed.
The time column keeps updating when the process state is in run state (makes sense). The moment it goes in to sleep state, the time cloumn doesn't update. The moment it comes in to run state, it doesn't reset the time to zero (until and unless it is new process). It just adds the time to the privious value.
How would I know, how much time the process has been in run state before it actually went in to sleep.
%CPU is used to sort the top process.
Also, could you please explain me the difference between %CPU and %WCPU. What is Raw and Weighted.
Cheers,
Ravi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2010 07:24 AM
01-02-2010 07:24 AM
Re: Process and CPU information
> How would I know, how much time the process has been in run state before it actually went in to sleep.
I don't think you can determine that very easily (at least not with 'top'). A far better tool for "drilling down" is 'glance'. In fact, since 'glance' is architected to understand the HP-UX kernel, it is probably the best tool for performance analysis on these systems.
> Also, could you please explain me the difference between %CPU and %WCPU. What is Raw and Weighted.
The "raw" value would be a value for that sampling interval only. A "weighted" value would take into account previous values to arrive at a "smoother" average for comparative purposes.
If you Google for "weighted average" you will find (among others):
http://en.wikipedia.org/wiki/Weighted_mean
At the least, this will give you a better understanding of "weighted".
Regards!
...JRF...