- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- CPU Utilization o HPUX
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
тАО02-03-2005 12:30 AM
тАО02-03-2005 12:30 AM
CPU Utilization o HPUX
I am running an OLTP application on 4 CPU 1GHZ HPUX 11i machine.I have a query
When I do online monitoring using glance utility i can see that ps command is using around 20% of the CPU utilization. The ps command utility is used in the C code written for the application.Can anyone suggest as to how to sort out this problem(i.e tuning kernel parameters or any efficient way to enhance the code to reduce the CPU utilization for ps command.
Regards
Sai Krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:15 AM
тАО02-03-2005 02:15 AM
Re: CPU Utilization o HPUX
Do you need to use glance?
There is also the unix command sar to measure utilization of the system resources.
With these amount of details it is difficult to tell why it is taking 20%.
- Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:39 AM
тАО02-03-2005 02:39 AM
Re: CPU Utilization o HPUX
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:47 AM
тАО02-03-2005 02:47 AM
Re: CPU Utilization o HPUX
Please post the options being used by the ps command from your code. Consider changing the options to something less CPU intensive.
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
тАО02-03-2005 03:10 PM
тАО02-03-2005 03:10 PM
Re: CPU Utilization o HPUX
I will tell you what exactly happens
In the C program this shell command is invoked
sh -c ps -p 22364 |grep um.scs 2>&1 >/dev/null
um.scs is the application whic runs in the background.This forks around 250 ps processes if I observe through glance. It also invokes lot of sh commands. Both of these amounts to 20%-25% of the CPU.Through glance i have set the parm file where
application = PS
file = ps
Friends, I do not know whether so much information is enough. But this is a major bottleneck in our application. Please do suggest a good approach whether i can use any other option in the code or any way to optimize the kernel parameters to reduce the CPU utilization.Please treat this as urgent.
Regards
Sai.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2005 01:31 AM
тАО02-04-2005 01:31 AM
Re: CPU Utilization o HPUX
So the questions are: why is the code running so many copies of ps? Does the code blindly run ps over and over as fast as it can? (bad programming) Is this code monitoring a process that is supposed to be running but crashes and needs a restart? If so, the correct solution is to fix the broken process, not keep trying to kickstart the um.scs over and over again.
Assuming that there is no way to fix the broken process, change the C code to use the following syntax:
sh -c UNIX95= ps -C um.scs > /dev/null 2>&1
What this will do is to eliminate grep (ALWAYS a good thing with ps), return all processes with the name um.scs (and NOT um.scs.1 or bum.scs, etc which is what grep would do), then change stdout to /dev/null, and finally redirect stderr to the current filehandle for stdout which is now /dev/null. Finally, this ps command should be run every 5 or 10 seconds and should complete within a few hundred milliseconds. But don't test this in the program until you test it manually from the command line. Start by running just the command without the redirection (and check the return code), as in:
UNIX95= ps -C um.sc
echo $?
After each run, the echo $? will be 0 for success in finding at least one match for um.scs, non-zero (typically 1) if the program cannot is not running.
Bill Hassell, sysadmin