- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- CPU Utilized
-
-
Categories
- Topics
- Hybrid IT with Cloud
- Mobile & IoT
- IT for Data & Analytics
- Transformation
- Strategy and Technology
- Products
- Cloud
- Integrated Systems
- Networking
- Servers and Operating Systems
- Services
- Storage
- Company
- Events
- Partner Solutions and Certifications
- Welcome
- Welcome
- Announcements
- Tips and Tricks
- Feedback
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- Converged Data Center Infrastructure
- Digital Transformation
- Grounded in the Cloud
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- Networking
- OEM Solutions
- Servers: The Right Compute
- Telecom IQ
- Transforming IT
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Categories
-
Forums
-
Blogs
-
InformationEnglish
CPU Utilized
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-31-2011 08:44 PM
12-31-2011 08:44 PM
CPU Utilized
CPU Utilized
Hi,
How can i know the percentage of CPU utilized by such process or by user, for example the percentage for all the root user process.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-01-2012 01:38 AM - edited 01-02-2012 01:15 AM
01-01-2012 01:38 AM - edited 01-02-2012 01:15 AM
Re: CPU Utilization
Re: CPU Utilization
top will give the percentage for each process. For a user, you would have to add them up.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-01-2012 02:07 AM
01-01-2012 02:07 AM
Re: CPU Utilized
Re: CPU Utilized
Hi,
ok, but I want to know the percentage of specific process on total CPU number, not on one CPU.
"For a user, you would have to add them up." do you mean
# top root =========> but i don't see any output related to root user
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-01-2012 02:24 AM - edited 01-02-2012 01:16 AM
01-01-2012 02:24 AM - edited 01-02-2012 01:16 AM
Re: CPU Utilization
Re: CPU Utilization
>I want to know the percentage of specific process on total CPU number, not on one CPU.
Then you just divide by the total number of CPUs.
>top root => but I don't see any output related to root user
You would need to add up all of the processes owned by root. Using ps(1) may be easier:
UNIX95=EXTENDED_PS ps -u root -opid= -ouser= -opcpu= -ocomm=
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-01-2012 03:53 AM
01-01-2012 03:53 AM
Re: CPU Utilized
Re: CPU Utilized
Hi,
thanks for your suppor, but What is the third line ?
# UNIX95=EXTENDED_PS ps -u elink -opid= -ouser= -opcpu= -ocomm=
12616 elink 0.34 perl_node
25954 elink 0.14 c_node
13969 elink 0.16 perl_node
9544 elink 0.77 perl_node
22468 elink 0.14 perl_node
8677 elink 0.19 c_node
16422 elink 0.38 perl_node
16835 elink 0.75 c_node
16046 elink 0.19 perl_node
22348 elink 0.25 perl_node
8389 elink 0.24 perl_node
22446 elink 0.21 perl_node
12928 elink 0.50 perl_node
7742 elink 0.33 perl_node
16539 elink 0.19 perl_node
11091 elink 0.42 perl_node
12487 elink 0.51 c_node
10736 elink 0.78 perl_node
24487 elink 0.37 perl_node
441 elink 1.96 perl_node
25203 elink 0.21 perl_node
< Then you just divide by the total number of CPUs > can you give me example
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-01-2012 04:04 AM - edited 01-02-2012 01:16 AM
01-01-2012 04:04 AM - edited 01-02-2012 01:16 AM
Re: CPU Utilization
Re: CPU Utilization
>What is the third line?
> UNIX95=EXTENDED_PS ps -u elink -opid= -ouser= -opcpu= -ocomm=
The third column is the percentage CPU time.
>Then you just divide by the total number of CPUs. Can you give me example:
UNIX95=EXTENDED_PS ps -u elink -opid= -ouser= -opcpu= -ocomm= |
awk -v cpus=$NUM -v user=elink '
{
cpu_percentage += $3
}
END { print "Total machine usage for", user ":", cpu_percentage / cpus; }'
Where $NUM is the number of CPUs on your machine.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-02-2012 12:34 AM
01-02-2012 12:34 AM
Re: CPU Utilized
Re: CPU Utilized
Hi,
thanks for your support, but i have the last quetions
how to get sar output of CPU utlization for 1 day and save it to file.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-02-2012 12:52 AM - edited 01-02-2012 01:16 AM
01-02-2012 12:52 AM - edited 01-02-2012 01:16 AM
Re: CPU Utilization
Re: CPU Utilization
>how to get sar output of CPU utilization for 1 day and save it to file.
Take a look at sar(1m), sadc(1m), sa1(1m) and sa2(1m).
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-02-2012 12:55 AM
01-02-2012 12:55 AM
Re: CPU Utilized
Re: CPU Utilized
you can use following hpux utilities to get CPU Utilized.
1. top
2. sar
3. glance
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-03-2012 12:14 AM
01-03-2012 12:14 AM
Re: CPU Utilized
Re: CPU Utilized
Hi
How about this?
UNIX95= ps -e -o "pcpu args" |sort -r | head -20
sample output
# UNIX95= ps -e -o "pcpu args" |sort -r | head -20
1.27 vxfsd
0.37 /opt/OV/bin/ovcd
0.32 /opt/wbem/lbin/cimprovagt 17 15 HPUXIOTreeIndicationProviderModule
0.23 /opt/hpservices/jre/opt/java1.4/jre/bin/IA64N/java -Xmx512m -DRunnerValuePairFile=/var/opt/runner/data/valuePairs -cp /opt/runn
0.20 vxsvc -r /opt/VRTSob/config/Registry -e
0.20 /opt/wbem/lbin/cimprovagt 13 11 SFMProviderModule
0.20 /opt/OV/lbin/eaagt/opcmsga
0.18 /opt/OV/lbin/conf/ovconfd
.
.
Thanks
____________________________________________
:: Really appreciate if you could assign some points.
:: Don't know how to assign point? Click the KUDOS! star!
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2018 Hewlett Packard Enterprise Development LP