iostat, vmstat, netstat – Performance Monitoring & Tuning in Unix & Linux

This document is primarily written with reference to Solaris performance monitoring and tuning but these tools are available in other Unix variants & Linux also with slight syntax difference.

iostat , vmstat and netstat are three most commonly used tools for performance monitoring . These comes built in with the operating system and are easy to use .iostat stands for input output statistics and reports statistics for i/o devices such as disk drives . vmstat gives the statistics for virtual Memory and netstat gives the network statistics .

Following pages describes these tools and their usage for performance monitoring explains their syntax , examples and explanantion of results and solution for the common problems.

iostat – Input Output statistics

iostat reports terminal and disk I/O activity and CPU utilization. The first line of output is for the time period since boot & each subsequent line is for the prior interval . Kernel maintains a number of counters to keep track of the values.

iostat’s activity class options default to tdc (terminal, disk, and CPU). If any other option/s are specified, this default is completely overridden i.e. iostat -d will report only statistics about the disks.

iostat syntax

Basic synctax is iostat interval count
option – let you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t or -tdc ) . x options gives the extended statistics .

interval – is time period in seconds between two samples . iostat 4 will give data at each 4 seconds interval.

count – is the number of times the data is needed . iostat 4 5 will give data at 4 seconds interval 5 times

iostat Example

$ iostat -xtc 5 2
                          extended disk statistics       tty         cpu
     disk r/s  w/s Kr/s Kw/s wait actv svc_t  %w  %b  tin tout us sy wt id
     sd0   2.6 3.0 20.7 22.7 0.1  0.2  59.2   6   19   0   84  3  85 11 0
     sd1   4.2 1.0 33.5  8.0 0.0  0.2  47.2   2   23
     sd2   0.0 0.0  0.0  0.0 0.0  0.0   0.0   0    0
     sd3  10.2 1.6 51.4 12.8 0.1  0.3  31.2   3   31

The fields have the following meanings:
      disk    name of the disk
      r/s     reads per second
      w/s     writes per second
      Kr/s    kilobytes read per second
      Kw/s    kilobytes written per second
      wait    average number of transactions waiting for service (Q length)
      actv    average number of transactions  actively being serviced 
(removed  from  the  queue but not yet completed)
      %w      percent of time there are transactions  waiting
              for service (queue non-empty)
      %b      percent of time the disk is busy  (transactions
                  in progress)

iostat Results and Solutions

The values to look from the iostat output are:
* Reads/writes per second (r/s , w/s)
* Percentage busy (%b)
* Service time (svc_t)

If a disk shows consistently high reads/writes along with , the percentage busy (%b) of the disks is greater than 5 percent, and the average service time (svc_t) is greater than 30 milliseconds, then one of the following action needs to be taken

  1. Tune the application to use disk i/o more efficiently by modifying the disk queries and using available cache facilities of application servers .
  2. Spread the file system of the disk on to two or more disk using disk striping feature of volume manager /disksuite etc.
  3. Increase the system parameter values for inode cache , ufs_ninode , which is Number of inodes to be held in memory. Inodes are cached globally (for UFS), not on a per-file system basis
  4. Move the file system to another faster disk /controller or replace existing disk/controller to a faster one.

Next Page – vmstat

DNS Troubleshooting

DNS troubleshooting , this article describes some of the common dns problems and their solutions.
First phase of article describes dns errors relating to configuration , server setup and its basic functionality . Second phase talks about the nslookup related errors when the dns servers seems to be working correctly but names resolution fail .

Solaris Error Messages A-D

Solaris / Unix error messages are very short and often we need some more information about the origin of an error and a possible steps to fix the issues.

Here is a list of Solaris / Unix error messages for your reference, most of the error messages are generic Unix error messages but many are specific Solaris Error Messages.  Please comment if you can provide some more details  about these errors.

This  is a multi part document ,  this part covers error messages starting from A to D

Solaris error messages L-N

Solaris / Unix error messages are very short and often we need some more information about the origin of an error and a possible steps to fix the issues.

Here is a list of Solaris / Unix error messages for your reference, most of the error messages are generic Unix error messages but many are specific Solaris Error Messages. Please comment if you can provide some more details about these errors.

This is a multi part document , this part covers error messages starting from L to N

Solaris Error messages E-K

Solaris / Unix error messages are very short and often we need some more information about the origin of an error and a possible steps to fix the issues.

Here is a list of Solaris / Unix error messages for your reference, most of the error messages are generic Unix error messages but many are specific Solaris Error Messages. Please comment if you can provide some more details about these errors.

Solaris Error Messages O-S

Solaris / Unix error messages are very short and often we need some more information about the origin of an error and a possible steps to fix the issues.

Here is a list of Solaris / Unix error messages for your reference, most of the error messages are generic Unix error messages but many are specific Solaris Error Messages. Please comment if you can provide some more details about these errors.

This is a multi part document, this part covers error messages starting from O to S,

Solaris Error Messages T-Z

Solaris / Unix error messages are very short and often we need some more information about the origin of an error and a possible steps to fix the issues.
Here is a list of Solaris / Unix error messages for your reference, most of the error messages are generic Unix error messages but many are specific Solaris Error Messages. Please comment if you can provide some more details about these errors.

Managing Sun OpenBoot Parameters and commands

Learn to access, display and set sun openboot parameters on a Sun servers and workstation for input output port , boot , security , diagnostics & more.

Veritas Volume Manager – vxdiskadm

Veritas Volume Manager is used to manage disk storage spread over an array of disks.

The main features of volume manager are following
1. Allows creation of logical volumes spanning over multiple disks. This overcomes the physical limit of the disk .
2. Provides high availability storage solutions through RAID ,Mirroring of disks .
3. Provides fail over features by providing transferable disk group ownership between systems.
4. Dynamic reconfiguration of disk storage in an online system state. what is veritas volume manager .

The following article describes the volume manager objects and configuration of these objects using a text menu based utility called vxdiskadm .

RefDesk

FAQ 

Solaris Documentation

Sun

Documentation Home

Patches & Software’s  

Certification Info

Others