Solaris Performance Monitoring & Tuning – iostat, vmstat, netstat
Introduction to iostat , vmstat and netstat
This document is primarily written with reference to solaris performance monitoring and tuning but these tools are available in other unix variants 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 statstics .
Following paragraphs describes these tools and their usage for performance monitoring.
Table of content :
1. Iostat
* Syntax
* example
* Result and Solutions
2. vmstat
* syntax
* example
* Result and Solutions
3. netstat
* syntax
* example
* Result and Solutions
Input Output statistics ( iostat )
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.
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
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)
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
Tags: iostat, netstat, Solaris Performance Monitoring, vmstat


January 2nd, 2010 at 10:57 am
Thanks. A very good explanation in layman terms. Finally I am not scared of these tools
– Dilip
January 14th, 2010 at 7:11 am
This is good troubleshooting tips for io related issues.
-ANIL PATIL
January 21st, 2010 at 10:23 pm
sugest few more paramets than iosta vmstat and netstat for performanec tunning of the server
January 31st, 2010 at 8:21 pm
Very Imformative
February 2nd, 2010 at 8:35 pm
Thanks, very helpful document
May 4th, 2010 at 9:14 pm
[...] Solaris Performance Monitoring – IOSTAT, VMSTAT, NETSTAT (Fuente de este artÃculo) [...]
May 9th, 2010 at 9:09 pm
[...] Solaris Performance Monitoring – IOSTAT, VMSTAT, NETSTAT (Fuente de este artÃculo) [...]
July 4th, 2010 at 9:52 am
Thanks, it is very helpful document
July 18th, 2010 at 7:54 pm
Very Informative.
July 29th, 2010 at 7:16 am
Thanks, very good document.
But, please, I have a issue about netstat command.
the output command netstat -na -i is like :
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 loopback localhost 77814 0 77814 0 0 0
lo0 8232 loopback localhost 77814 0 77814 0 0 0
hme0 1500 server1 server1 10658 3 48325 0 279257 0
hme0 1500 server1 server1 10658 3 48325 0 279257 0
why I have duplicade name of interfaces ?
Thanks advanced
Joao Paulo
August 5th, 2010 at 4:42 am
Realy It is very good explanation of vmstat, iostat,netstat tool
specialy , mentioned how to identify problem and resolve it.
Thanks a lot
Regards,
kk