- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cpu average using C Api on HP-UX 11.0
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
04-18-2004 07:47 PM
04-18-2004 07:47 PM
I have executed this C Api to have the avearge consuming of my cpu.
#include
#include
struct pst_dynamic psd; // dynamic system info -- stuff that change change
pstat_getdynamic ( &psd, sizeof ( psd ), (size_t)1 );
printf ( "1-minute: %lf, 5-minute: %lf, 15-minute: %lf\n",
psd.psd_avg_1_min,
psd.psd_avg_5_min,
psd.psd_avg_15_min );
Result;
1-minute load avg: 0.084683
5-minute load avg: 0.094141
15-minute load avg: 0.14590
For example, 1-minute load avg: 0.084683 what does it means? and How can i calculate the rate of Idle with these values?
Considering that my Idle is 99.6%,
ho can i transform
1-minute load avg: 0.084683
5-minute load avg: 0.094141
15-minute load avg: 0.145902 to have 99.6% IDLE?
#top (result of top command)
LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0.09 0.2% 0.0% 0.2% 99.6% 0.0% 0.0% 0.0% 0.0%
Hope you can help me.
Thanks
Alex
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2004 07:55 PM
04-18-2004 07:55 PM
			
				
					
						
							Re: Cpu average using C  Api on HP-UX 11.0
						
					
					
				
			
		
	
			
	
	
	
	
	
Are you sure you can transform the load average wich is a ponderated machine wide average based on CPU runQ to CPU utilisation ?
What append when the box have multiple CPU ?
Cheers
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2004 10:23 PM
04-18-2004 10:23 PM
			
				
					
						
							Re: Cpu average using C  Api on HP-UX 11.0
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2004 10:44 PM
04-18-2004 10:44 PM
			
				
					
						
							Re: Cpu average using C  Api on HP-UX 11.0
						
					
					
				
			
		
	
			
	
	
	
	
	
You may have one process consuming 100 percent of your cpu, while no other process wish to run, what will give you low load average, while 0 precent of idle cpu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2004 11:13 PM
04-18-2004 11:13 PM
			
				
					
						
							Re: Cpu average using C  Api on HP-UX 11.0
						
					
					
				
			
		
	
			
	
	
	
	
	
May I suggest a more primitive yet more precise way of getting the CPU consuption info. Have you considered using the standard HP tool to dump the resullt in file or a pipe and read the result set from you C program ?
Furthermore, resource accounting is one very complex task. If you choose to depend on the standard tool, your executable will benefit from the OS improvement.
Cheers,
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2004 03:01 AM
04-19-2004 03:01 AM
SolutionTake a look at this, it might help you :
http://search.hp.com/redirect.html?url=http%3A//forums1.itrc.hp.com/service/forums/questionanswer.do%3FthreadId%3D137120&qt=pstat.h&hit=1
http://h21007.www2.hp.com/dspp/files/unprotected/hpux/u_faqs.pdf
Cheers
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2004 10:24 PM
04-19-2004 10:24 PM
			
				
					
						
							Re: Cpu average using C  Api on HP-UX 11.0
						
					
					
				
			
		
	
			
	
	
	
	
	
i am verifying your documentation...
