- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: DISK STATISTICS
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
10-21-2002 01:04 AM
10-21-2002 01:04 AM
How to get the disk statistics of the devices same as v get through "sar -d 1 10" command . Actually i want to write a C funtion which give me all the details like device , %busy, avque, r+w/s, blks/s avwait , avserv.
Is there any structure in HPUX that gives all this information ??. If it is how to get info from it ??
The reason i cant use because sar command its not giving all the details of all the disk attached to the system.
Because if i c "/dev/dsk" directory there r 4 devices attached and sar is giving me only detail of 2.
Waiting for ur reply
hemant
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 01:14 AM
10-21-2002 01:14 AM
Re: DISK STATISTICS
Sar -d will only give statistics on disks that have activity, so getting the %busy, avque, r+w/s, blks/s avwait , avserv on non active disks will result in nul/no activity results.
Because the disks do not appear in the sar -d output therefore does not mean that sar is incorrect, just that they are not in use at the time that sar was collecting data.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 01:15 AM
10-21-2002 01:15 AM
Re: DISK STATISTICS
The sar command uses the pstat(2) interface to get that information. In your case you should have a look at pstat_getdisk().
There are also examples in the man page.
Regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 01:31 AM
10-21-2002 01:31 AM
Re: DISK STATISTICS
Thanks for the reply .I tried using the pstat_getdisk function . But struct pst_diskinfo has no information about "device %busy , avque, r+w/s, blks/s , avwait , avserv " field . Please correct me if i m wrong !
thanks
hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 04:13 AM
10-21-2002 04:13 AM
SolutionMost of them are cumulative values... so you need to take 2 samples, get the differences then do some maths with it.
E.g.:
avwait = ( ( (float)DEV_DIFF_USEC(psd_dkwait) ) / 1000.0 ) /
(float)DEV_DIFF(psd_dkq_merged);
avserv = ( ( (float)DEV_DIFF_USEC(psd_dkresp) ) -
( (float)DEV_DIFF_USEC(psd_dkwait) ) );
So it's not trivial...
Regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2002 10:13 PM
10-21-2002 10:13 PM
Re: DISK STATISTICS
Thats really a great ! thanks a lot for it !
Could u please tell me the algo for the %bsy and avque r+w/s field also . How to calculate it ?? . Where i can find this info for calculating it....
One more thing pstat_getdisk sycall , return the number of disk attached to the system is this true ??.
waiting for ur reply
thanks and regard
hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2002 12:03 AM
10-22-2002 12:03 AM
Re: DISK STATISTICS
The formulas are not documented explicitely... however, one may derive them from performance tuning guides. So it's not a big secret. :)
Here we are:
busy_percent = MAX( (float) DEV_DIFF (psd_dktime) / delta_time * 100.0 , 100 );
avque = (float)DEV_DIFF(psd_dkqlen) / (float)DEV_DIFF(psd_dkq_merged) -1;
rw = (float) DEV_DEV_DIFF(psd_dkq_merged) / delta_time * 100;
(delta_time is in ticks... 100 ticks/sec).
The syscall returns the number of structs it filled to buf. So it's:
MIN (#disks, elemcount)
Regards...
Dietmar.