|
Iostat (Input Output statistics) on Solaris
The iostat command is used for monitoring system input/output device. The iostat
command generates reports that can be used to change system configuration to
better balance the input/output load between physical disks. It is a very useful
utility for DBAs as we need it to check tablespace I/O for better database
performance.
The first report generated by the iostat command provides statistics concerning
the time since the system was booted. Each subsequent report covers the time
since the previous report. All statistics are reported each time the iostat
command is run. The report consists of a CPU header row followed by a row of CPU
statistics. On multiprocessor systems, CPU statistics are calculated system-wide
as averages among all processors. A device header row is displayed followed by a
line of statistics for each device that is configured.
Syntax:
The basic synctax is below.# iostat <options> interval count
Where:
option - is the device for which information is needed like CPU, Disk or Terminal (-c, -d , -t or -cdt ).
You can also use x options to report the extended statistics .
e.g. iostat -cdtx
interval - is time period in seconds between two samples .
e.g. "iostat 2" will give data at each 2 seconds interval.
count - is the number of times the data is needed .
e.g. "iostat 2 4" will give data 4 times at each 2 seconds interval.
An example of the iostat is below.
#iostat -xd 2 4
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
lofi1 11.5 0.0 44.9 0.0 0.0 0.0 0.1 0 0
lofi2 0.4 0.3 0.3 0.1 0.0 0.0 1.0 0 0
md10 0.0 0.1 0.3 0.1 0.0 0.0 14.3 0 0
md11 0.0 0.1 0.3 0.1 0.0 0.0 14.3 0 0
sd21 0.0 0.0 0.0 0.0 0.0 0.0 241.8 0 0
sd30 0.0 0.0 0.3 0.3 0.0 0.0 10.7 0 0
sd60 0.0 0.0 0.0 0.0 0.0 0.0 4.5 0 0
sd61 0.0 0.0 0.0 0.0 0.0 0.0 4.5 0 0
sd62 0.0 0.0 0.0 0.0 0.0 0.0 4.5 0 0
sd63 0.0 0.0 0.0 0.0 0.0 0.0 4.4 0 0
Where
device Disk device name
r/s Reads per second
w/s Writes per second
Kr/s kb read per second
Kw/s kb 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)
svc_t Service time (ms). Includes everything: wait time, active queue time, seek
rotation, transfer time
%w Percent of time there are transactions waiting for service (queue non-empty)
%b Percent of time the disk is busy (transactions in progress)
Analysis the results:
The following are main areas to focus in the report.
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
-
Modifying the disk queries and using available cache facilities of application
servers to use disk i/o more efficiently.
-
Implement the RAID or similar solution.
-
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.
-
Replace the existing disk/controller with a faster one or move files to another
file system.
|