SAR is an important performance detection command under Solaris, and familiarity with this command can detect system performance in a timely manner, and is helpful for system management.
Use the SAR command to perform the following tasks:
Organize and view data about system activity.
Access system activity data based on special requests.
Generate automatic reports to measure and monitor system performance and generate special request reports to identify specific performance issues.
How to check file access (SAR-A)
Use the SAR-A command to display file access operation statistics.
$ sar-a
SunOS balmyday 5.10 s10_51 sun4u 03/18/2004
00:00:00 iget/s namei/s dirbk/s
01:00:00 0 3 0
02:00:00 0 3 0
03:00:00 0 3 0
04:00:00 0 3 0
05:00:00 0 3 0
06:00:00 0 3 0
07:00:00 0 3 0
08:00:00 0 3 0
08:20:01 0 3 0
08:40:00 0 3 0
09:00:00 0 3 0
09:20:01 0 10 0
09:40:01 0 1 0
10:00:02 0 5 0
Average 0 4 0
The following list describes the field names and descriptions of the operating system routines reported by the Sar-a command.
iget/s
The number of requests made to an inode that is not located in the directory name lookup cache (directory name look-up cache, DNLC).
namei/s
The number of file system paths searched per second. If Namei cannot find the directory name in DNLC, it calls Iget to get the inode for the file or directory. Therefore, most igets are the result of DNLC omission.
dirbk/s
Number of directory block reads emitted per second.
The larger the reported values of these operating system routines, the more time the kernel will take to access user files. The length of time will reflect the extent to which programs and applications use file systems. The-a option helps you see how the disk relates to the application.
How to check buffer activity (sar-b)
Use the Sar-b command to display buffer activity statistics.
Buffers are used to cache metadata. Metadata includes inode, cylinder group blocks, and indirect blocks.
$ sar-b
00:00:00 bread/s lread/s%rcache bwrit/s lwrit/s%wcache pread/s pwrit/s
01:00:00 0 0 100 0 0 55 0 0
Example Check buffer activity (sar-b)
The following Sar-b command output example shows that the%rcache and%wcache buffers do not cause a rate drop. All data is within an acceptable limit.
$ sar-b
SunOS balmyday 5.10 s10_51 sun4u 03/18/2004
00:00:04 bread/s lread/s%rcache bwrit/s lwrit/s%wcache pread/s pwrit/s
01:00:00 0 0 100 0 0 94 0 0
02:00:01 0 0 100 0 0 94 0 0
03:00:00 0 0 100 0 0 92 0 0
04:00:00 0 1 100 0 1 94 0 0
05:00:00 0 0 100 0 0 93 0 0
06:00:00 0 0 100 0 0 93 0 0
07:00:00 0 0 100 0 0 93 0 0
08:00:00 0 0 100 0 0 93 0 0
08:20:00 0 1 100 0 1 94 0 0
08:40:01 0 1 100 0 1 93 0 0
09:00:00 0 1 100 0 1 93 0 0
09:20:00 0 1 100 0 1 93 0 0
09:40:00 0 2 100 0 1 89 0 0
10:00:00 0 9 100 0 5 92 0 0
10:20:00 0 0 100 0 0 68 0 0
10:40:00 0 1 98 0 1 70 0 0
11:00:00 0 1 100 0 1 75 0 0
Average 0 1 100 0 1 91 0 0