Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
24.  Monitoring System Performance (Tasks) Displaying Disk Utilization Information (iostat n) How to Display Disk Utilization Information (iostat)  Previous   Contents   Next 
   
 

Example--Displaying Disk Utilization Information

The following example shows disk statistics that were gathered every five seconds.

$ iostat 5
tty        sd0           sd6           nfs1         nfs49           cpu
tin tout kps tps serv  kps tps serv  kps tps serv  kps tps serv  us sy wt id
 0    0   1   0   49    0   0    0    0   0    0    0   0   15   0  0  0 100
 0   47   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16  44   6  132    0   0    0    0   0    0    0   0    0   0  0  1 99
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   3   1   23    0   0    0    0   0    0    0   0    0   0  0  1 99
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100
 0   16   0   0    0    0   0    0    0   0    0    0   0    0   0  0  0 100

How to Display Extended Disk Statistics (iostat -xtc)

Run the iostat -xtc command to get extended disk statistics.

$ iostat -xtc
                  extended device statistics                      tty         cpu
device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b  tin tout  us sy wt id
fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0    0    0   0  0  0 100
sd0          0.0    0.0    0.4    0.4  0.0  0.0   49.5   0   0 
sd6          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 
nfs1         0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0 
nfs49        0.0    0.0    0.0    0.0  0.0  0.0   15.1   0   0 
nfs53        0.0    0.0    0.4    0.0  0.0  0.0   24.5   0   0 
nfs54        0.0    0.0    0.0    0.0  0.0  0.0    6.3   0   0 
nfs55        0.0    0.0    0.0    0.0  0.0  0.0    4.9   0   0 

The iostat -xtc command displays a line of output for each disk. The output fields are described in the following table.

Table 24-5 Output From the iostat -xtc Command

Field Name

Description

r/s

Reads per second

w/s

Writes per second

kr/s

Kbytes read per second

kw/s

Kbytes written per second

wait

Average number of transactions that are waiting for service (queue length)

actv

Average number of transactions that are actively being serviced

svc_t

Average service time, in milliseconds

%w

Percentage of time that the queue is not empty

%b

Percentage of time that the disk is busy

Displaying Disk Space Statistics (df)

Use the df command to show the amount of free disk space on each mounted disk. The usable disk space that is reported by df reflects only 90 percent of full capacity, as the reporting statistics leave a 10 percent above the total available space. This head room normally stays empty for better performance.

The percentage of disk space actually reported by the df command is used space divided by usable space.

If the file system exceeds 90 percent capacity, you could transfer files to a disk that is not as full by using the cp command, or to a tape by using the tar or cpio commands. Or, you could remove the files.

For a detailed description of this command, see df(1M).

How to Display Disk Space Information (df)

Use the df -k command to display disk space information in Kbytes.

$ df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t3d0s0     192807   40231  133296    24%    / 

The following table describes the df -k command output.

Table 24-6 Output From the df -k Command

Field Name

Description

kbytes

Total size of usable space in the file system

used

Amount of space used

avail

Amount of space available for use

capacity

Amount of space used, as a percentage of the total capacity

mounted on

Mount point

Example--Displaying File System Information

The following example shows the df -k command output.

$ df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0     384120  131596  214112    39%    /
/dev/dsk/c0t0d0s6    1388419 1050390  282493    79%    /usr
/proc                      0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
fd                         0       0       0     0%    /dev/fd
swap                  467152      40  467112     1%    /var/run
swap                  467160      48  467112     1%    /tmp
/dev/dsk/c0t0d0s4    1784644 1525360  205745    89%    /export
venus:/usr/dist    20612581 13237316 6963015    66%    /usr/dist

Monitoring System Activities (sar)

Use the sar command to do the following:

  • Organize and view data about system activity

  • Access system activity data on a special request basis

  • Generate automatic reports to measure and monitor system performance, and special request reports to pinpoint specific performance problems. "Collecting System Activity Data Automatically (sar)" describes these tools.

For a detailed description of this command, see sar(1).

How to Check File Access (sar -a)

Display file access operation statistics with the sar -a command.

$ sar -a
SunOS venus 5.9 Generic sun4u    06/24/2001

00:00:00  iget/s namei/s dirbk/s
01:00:00       0       0       0
02:00:02       0       0       0
03:00:00       0       1       0
04:00:00       0       0       0
05:00:01       0       0       0
06:00:00       0       0       0

Average        0       1       0

The following table describes the operating system routines that are reported by the sar -a command.

Table 24-7 Output from the sar -a Command

Field Name

Description

iget/s

The number of requests made for inodes that were not in the directory name look-up cache (DNLC).

namei/s

The number of file system path searches per second. If namei does not find a directory name in the DNLC, it calls iget to get the inode for either a file or directory. Hence, most igets are the result of DNLC misses.

dirbk/s

The number of directory block reads issued per second.

The larger the reported values, the more time the kernel is spending to access user files. The amount of time reflects how heavily programs and applications are using the file systems. The -a option is helpful for viewing how disk-dependent an application is.

 
 
 
  Previous   Contents   Next