Section 4.13. sar -d


4.13. sar -d

iostat is not the only kstat disk statistics consumer in Solaris; there is also the system activity reporter, sar. This is both a command (/usr/sbin/sar) and a background service (in the crontab for sys) that archives statistics over time and keeps them under /var/adm/sa. In Solaris 10 the service is called svc:/system/ sar:default. It can be enabled by svcadm enable sar.[8]

[8] Pending bug 6302763.

Gathering statistics over time can be especially valuable for identifying long-term patterns. Such statistics can also help identify what activity is "normal" for your disks and can highlight any change around the same time that performance problems were noticed. The disks may not misbehave the moment you analyze them with iostat.[9]

[9] Some people do automate iostat to run at regular intervals and log the output. Having this sort of comparative data on hand during a crisis can be invaluable.

To demonstrate the disk statistics that sar uses, we can run it by providing an interval.

# sar -d 5 SunOS mars 5.11 snv_16 sun4u    02/21/2006 15:56:55   device        %busy   avque   r+w/s  blks/s  avwait  avserv 15:57:00   dad1             58     0.6     226    1090     0.0     2.7            dad1,a           58     0.6     226    1090     0.0     2.7            dad1,b            0     0.0       0       0     0.0     0.0            dad1,c            0     0.0       0       0     0.0     0.0            dad1,d            0     0.0       0       0     0.0     0.0            dad1,e            0     0.0       0       0     0.0     0.0            dad1,f            0     0.0       0       0     0.0     0.0            dad1,g            0     0.0       0       0     0.0     0.0            fd0               0     0.0       0       0     0.0     0.0            nfs1              0     0.0       0       0     0.0     0.0            sd1               0     0.0       0       0     0.0     0.0 


The output of sar -d includes many fields that we have previously discussed, including percent busy (%busy), average wait queue length (avque), average wait queue time (avwait), and average service time (avserv). Since sar reads the same Kstats that iostat uses, the values reported should be the same.

sar -d also provides the total of reads + writes per second (r+w/s), and the number of 512 byte blocks per second (blk/s).[10]

[10] It's possible that sar was written before the kilobytes unit was conventional.

The disk statistics from sar are among its most trustworthy. Be aware that sar is an old tool and that many parts of Solaris have changed since sar was written (file system caches, for example). Careful interpretation is needed to make use of the statistics that sar prints.

Some tools plot the sar output, [11] which affords a helpful way to visualize data. So long as we understand what the data really means.

[11] Solaris 10 does ship with StarOffice 7, which can plot interactively.




Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net