Saturday, November 26

Input Output statistics ( Iostat )

Iostat command (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.

syntax:
Basic synctax is iostat  < options > interval count

option - let you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t or -tdc ) E gives error statistics and n expands disk names (-E, -n or –En). 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.

Identifying the bottlenecks:
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.

The ouput 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)

No comments:

Post a Comment