- 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
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
тАО06-30-2009 06:56 AM
тАО06-30-2009 06:56 AM
We are uning Linux (Redhat and Suse) and HPUX (11.00 and 11.11).
Adventnet's monitoring tool "opsmanager" is being used to monitor the Linux and HPUX servers.
Actually we are getting lot of alert messages for more CPU and Memory utilization in almost all servers.
But we can find idle CPU - 90% thru "top" command manually.
Is there any command to find the total CPU utilization and Memory utilization for eahc platform Linux and HPUX?
How to find the Top 3 CPU and Memory Utilized process?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2009 06:59 AM
тАО06-30-2009 06:59 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
>>Is there any command to find the total CPU utilization and Memory utilization for eahc platform Linux and HPUX?<<
many. top, sar, vmstat, glance, etc..
>>How to find the Top 3 CPU and Memory Utilized process?<<
ofcourse top command will provide the top resource consuming process. Glance is more sphosticated tool.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2009 06:59 AM
тАО06-30-2009 06:59 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
> How to find the Top 3 CPU and Memory Utilized process?
Instantly in a single interval or over some period of time?
One of the best tools for performance monitoring in HP-UX is 'glance'. If you don't have it, you should. A 30-day trial version can be obtained from the Application CDRoM.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2009 07:01 AM
тАО06-30-2009 07:01 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
I would use this for memory processes:
http://www.hpux.ws/?p=8
I would then re-write it to get the top three cpu processes, which is pretty easy.
You say:
>>
Adventnet's monitoring tool "opsmanager" is being used to monitor the Linux and HPUX servers.
<<
My response is I can do it just as well with a shell script for less money.
Why are we mentioning this tool? I'm confused.
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-01-2009 04:11 AM
тАО07-01-2009 04:11 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
1) I need detailed notes for understanding the outputs of top, sar, vmstat, glance.
Hi Steven,
Do you have any sample script for total cpu, memory utilization and top 3 or 10 process based on memory and cpu utilization?.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2009 04:32 AM
тАО07-01-2009 04:32 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
You say, my comments inline:
1) I need detailed notes for understanding the outputs of top, sar, vmstat, glance.
top:
http://www.webmasterworld.com/forum40/1205.htm
http://www.teamquest.com/resources/gunther/display/5/
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2006-08/msg00172.html
http://www.cyberciti.biz/tips/understanding-linux-and-unix-load-average.html
sar is more of an rtfm issue:
http://www.unix.com/hp-ux/42198-sar-output-gives-98-idle-cpu.html
http://www-d0.fnal.gov/computing/archive/unix_sys_diag.html
http://groups.google.com/group/comp.unix.solaris/browse_thread/thread/c9b7c62cc92c5fb8?pli=1
vmstat:
http://www.unix.com/unix-advanced-expert-users/30984-output-vmstat.html
http://www.remote-dba.net/t_tuning_vmstat_utility.htm
http://www.adminschoice.com/docs/iostat_vmstat_netstat.htm
I will skip glance because the man pages are written by HP and are excellent.
Hi Steven,
Do you have any sample script for total cpu, memory utilization and top 3 or 10 process based on memory and cpu utilization?.
This utility accepts command line input. If you tell it 3 or 10 as the first command line parameter that is how many processes it will monitor. It shows the top processes in terms of memory use.
http://www.hpux.ws/?p=8
As I said earlier, I am looking at writing one that does this based on top CPU users.
I'm looking at the code and seeing how easy or hard this is going to be to get done.
SEO
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-01-2009 05:02 AM
тАО07-01-2009 05:02 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Here is the heart of the HP-UX code in the leak detector:
if [ -z "$FILTER" ]
then
CL="ps -ef -o pid,sz,vsz,args | sort -nr -k 2,3| head -$NUM"
else
CL="ps -a -o pid,sz,vsz,args -C $FILTER | sort -nr -k 2,3| head -$NUM"
fi
;;
It merely does a reverse sort largest to smallest on fields two and three.
To modify it to get the top CPU users, I would think we would need to add the right ps fields and sort by them.
It looks simple. I'm suddenly interested in this.
I would set up a new command line argument for the utility to permit a switch to determine the output.
The parameter we would want to use is pcpu
So I would say quick and dirty you can simply modify this utility to get you top cpu users.
I'm looking at posting an update that will make my handy dandy memory leak detector able to do what you wish it to do.
I'm actually starting up my HP-UX system in anticipation of testing this.
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-02-2009 02:47 AM
тАО07-02-2009 02:47 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
this part works:
ps -ef -o pid,sz,vsz,args,pcpu | sort -nr -k 5| head -n 3
The head statement gets you the top 3 after a sort
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-02-2009 04:47 AM
тАО07-02-2009 04:47 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
I am using HPUX 10.20, 11.00 and 11.11.
that command is throwing error message.
Ex:
root@lgsna:/root > ps -ef -o pid,sz,vsz,args,pcpu | sort -nr -k 5| head -n 3
ps: illegal option -- o
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 05:27 AM
тАО07-02-2009 05:27 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-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.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2009 11:40 AM
тАО07-13-2009 11:40 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
> 3) why pmem is not working in HPUX, how to solve this?
Why do YOU think? Did you READ the manpages? Do you believe that all flavors of UNIX and/or LINUX are indentical?
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2009 11:52 AM
тАО07-13-2009 11:52 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Take a look at my code.
One set for HP-UX
One set for Linux
One set for Solaris.
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-14-2009 06:10 AM
тАО07-14-2009 06:10 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
Please attach file.
Hi James,
If pmem is not working, what is the alternative command that we can use for finding the percentage of total memory usage and top 3 memory using process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2009 06:19 AM
тАО07-14-2009 06:19 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
You can use top and glance command for this.
Regards
Sunny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2009 06:32 AM
тАО07-14-2009 06:32 AM
Re: CPU Utilization, Memory Utilization and TOP 3 CPU and Memory Utilized process.
http://www.hpuxconsulting.com/mem.mon
wget http://www.hpuxconsulting.com/mem.mon
That will get you a copy.
I don't want to actually attach the file because I'm working on a revision and when I replace this file, I want links to be good.
Take a look at the code that builds the variable CL
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com