- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: CPU Utilization, Memory Utilization and TOP 3 ...
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
Discussions
Discussions
Forums
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
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
тАО07-02-2009 05:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 09:54 AM
тАО07-02-2009 09:54 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
It will help you
# UNIX95= ps -e -o "vsz pcpu ruser pid stime time state args" | sort -rn |head -3
regards
Sanjeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 10:08 AM
тАО07-02-2009 10:08 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Notice very carefully that there is no semicolon on the command line after "UNIX95=".
Writing :
# UNIX95= ps ...
(or as Dennis likes to do:
# UNIX95=EXTENDED_PS ps ...
sets the UNIX95 (XPG4) behavior _only_ for the duration of the commmand line. You do not want to capriciously set UNIX95 in your shell environment. WHen set, the behavior of various commands is subtly altered. With 'ps' the option is required to use a custom output format ( the '-o' arguments ).
Using 'UNIX95' as an lvalue (left of an equal sign) sets it regardless of whether or not anything follows the equal (assignment) sign. Its for this reason that Dennis prefers his notation --- clarity. You could do:
# UNIX95=1 ps ...
OR:
# UNIX95=0 ps ...
OR:
# UNIX95= ps ...
ALL three forms are equivalent so beware.
See the manpages for 'ps(1)' for more about the UNIX95 (XPG4) behavior; the '-o' option and others!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 10:50 AM
тАО07-02-2009 10:50 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Yes, my post requires UNIX95 be set, it was pulled from a script that uses UNIX95.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 10:25 AM
тАО07-06-2009 10:25 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Thanks a lot.
Why we are using UNIX95.
Pls explain me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 11:05 AM
тАО07-06-2009 11:05 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
The UNIX95 variable needs to be set in order for my ps command to work.
If UNIX95 is not set to 1 you don't get the process information my command requests.
Why? Really I never asked. I just took it for granted and did it. Maybe that says something about me.
http://groups.google.com/group/comp.os.linux/browse_thread/thread/ea49dc5b68670333/f0b5f70e6e7a758c
http://www.springerlink.com/content/h5933m7011504052/
You may have to do some reading.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 01:24 PM
тАО07-06-2009 01:24 PM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
> SEP: The UNIX95 variable needs to be set in order for my ps command to work. If UNIX95 is not set to 1 you don't get the process information my command requests.
Wrong! You can set it to _ANY_ value, even to zero (0). Read again my post above of July 2. What matters is that UNIX95 is an lvalue.
> SEP: Why? Really I never asked. I just took it for granted and did it.
Empirical data is very enlightening. Heuristics help too.
> Senthil: Why we are using UNIX95.
The simple answer is that to use the '-o' format of the 'ps' option you need to set XPG4 (UNIX95) behavior. That's what the manpages would tell you!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 02:25 PM
тАО07-06-2009 02:25 PM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
The UNIX95 variable needs to be set in order for my ps command to work.
If its not set to something, the command will not work.
Please tell me if that statement requires parsing?
To summarize my statement. I never knew why I used UNIX95, except if I didn't set it, the utilities on my web site and the successors I'm developing for this thread WOULD NOT WORK.
>>>>
The simple answer is that to use the '-o' format of the 'ps' option you need to set XPG4 (UNIX95) behavior. That's what the manpages would tell you!
<<<
Thanks for the explanation and parsing.
Please do not assign any points to this answer.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 12:24 AM
тАО07-07-2009 12:24 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2009 11:26 AM
тАО07-13-2009 11:26 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Now i have found some commands to find the cpu and memory utilization.
1)Linux:
1.1)percentage of total cpu utilization:
# ps -eo user,pid,pcpu,comm | awk '{x += $3} END {print x}'
23.2
1.2)Top 3 CPU utilizing process:
# ps -eo user,pid,pcpu,comm | sort -nrbk3 | head -3
oracle 11730 21.5 oracle
oracle 12732 5.0 oracle
oracle 12670 3.3 oracle
1.3)percentage of total memory utilization:
# ps -eo user,pid,pmem,comm | awk '{x += $3} END {print x}'
2.1
1.4)top 3 memory utilizing process.
emdlagas1105:~ # ps -eo user,pid,pmem,comm | sort -nrbk3 | head -3
eekcpq 10315 1.1 Ice
lsutto 20414 1.0 java
root 31928 0.0 snmpd
2)HP UNIX:
2.1)percentage of total CPU utilization:
root>UNIX95= ps -eo user,pid,pcpu,comm | awk '{x += $3} END {print x}'
35.99
2.2)Top 3 CPU utilized process:
root> UNIX95= ps -eo user,pid,pcpu,comm | sort -nrbk3 | head -3
bpulak 26189 2.47 smbd
oracle9 29795 1.13 oraclemaximolg
root 1038 0.86 syncer
2.3)percentage of total memory utilization:
The below command is not working.
root > UNIX95= ps -eo user,pid,pmem,comm | awk '{x += $3} END {print x}'
ps: pmem is not a valid field name
2.4)Top 3 memory utilized process:
UNIX95= ps -eo user,pid,pmem,comm | sort -nrbk3 | head -3
ps: pmem is not a valid field name
I have follwoing questions:
1) are all 1.1, 1.2, 1,3, 1.4 are correct?
2) are all 1.1, 1.2 are correct?
3) why pmem is not working in HPUX, how to solve this?
4)do you have any other method to find the cpu utilization and memory utilization like above.?