Sei sulla pagina 1di 10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

Solaris 10

Linux

Solaris 11

VCS

VxVM

Hardware

Scripting

Storage

12 iostat examples for Solaris


performance troubleshooting
by Sandeep Patil Leave a Comment

Iostat is one of the most useful command when


troubleshooting a disk I/O performance issue. It can also be
used to troubleshoot a CPU performance issue as well. The
iostat command can be run in various ways.

Summary since boot


By default if you run iostat without any options it will show the
summary since boot which is very useful to compare the
system performance in a bottleneck vs average system
performance.
Example 1
# iostat
tty
sd0
sd1
sd2
sd3
tin tout kps tps serv kps tps serv kps tps serv kps tps serv
0
5 18
1
19
0
0
0
0
0
0
0
0
0

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

cpu
us sy wt id
0 1 0 99

1/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

The output shows all the device instances as well as terminal


and cpu statistics. Below are the parameter being displayed :
kps - kilobytes per second.
tps - transactions per second.
serv - average service time.

tin - terminal in chars


tout - terminal out chars

us - % user time
sy - % system time
wt - % I/O wait time (ignore this as it is no longer calculated & will always return 0)
id - % Idle time

Current statistics
The current disk I/O statistics need to be analyzed, which can
be done by running iostat over some period of time. The
syntax to run iostat at some interval with some optional count
is :
# iostat

Example 2
To run iostat at 1 seconds interval with a count of 5 :
# iostat 1 5
tty
sd0

sd1

sd2

sd3

cpu

tin tout kps tps serv kps tps serv kps tps serv kps tps serv
0
6 17
1
18
0
0
0
0
0
0
0
0
0

us sy wt id
0 1 0 99

0 235
0
80

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0 0 0 99
0 0 0 100

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0 1 0 99
0 1 0 99

81
80

Display Only disk statistics


Classic style
The default iostat also shows the CPU statistics. To display
only the disk statistics use the -d otion. This would print disk
http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

2/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

statistics in a classic way with kps, tps and serv values.


Example 3
# iostat -d 1 3
sd0

sd1

sd2

sd3

kps tps serv kps tps serv kps tps serv kps tps serv
16
0
18
0
0
0
0
0
0
0
0
0
0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

I actually have 5 disks in my system, but the above output


only shows disk statistics for 4 disk only. Thats because the
default iostat command shows disk statistics only for first 4
disks. To print disk statistics for more than 4 disk we can use
-l option ( we can provide number of disks for which we want
disk statistics with l )
Example 4
# iostat -dl 5 1 3
sd0
sd1

sd2

sd3

sd4

kps tps serv kps tps serv kps tps serv kps tps serv kps tps serv
16
0
18
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

In the example above 5 is number of disk to print the statistics


for and (1 3) is the interval and count respectively.
Ne w style
In the latest style of iostat command with option -D, we get
rps (reads per second), wps (write per second), and util (%
utilization).
Example 5
# iostat -D 1 3
sd0

sd1

sd2

sd3

rps wps util rps wps util rps wps util rps wps util
0
0

0 0.3
0 0.0

0
0

0 0.0
0 0.0

0
0

0 0.0
0 0.0

0
0

0 0.0
0 0.0

0 0.0

0 0.0

0 0.0

0 0.0

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

3/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

Statistics for a specific disk(s)


We can also get disk I/O statistics only for a specific disk or
set of disk using iostat :
Example 6
# iostat -dl 2 sd0 sd4 1 3
sd0

sd4

kps tps serv kps tps serv


16
0
18
0
0
0
0

Remember to limit the disks shown in output with l, otherwise


it would print all disk anyways.

To print logical disk names


Most of the times we understand logical disk names. So to
print disk I/O statistics using the logical disk names use the
option -n :
Example 7
# iostat -n
tty
c8t0d0

c8t1d0

c7t0d0

c8t2d0

cpu

tin tout kps tps serv kps tps serv kps tps serv kps tps serv
0

5 16

18

us sy wt id
0 1 0 99

Extended Device statistics


The option -x displays the extended device statistics.
Example 8
# iostat -x
extended device statistics
device

r/s

w/s

kr/s

kw/s wait actv svc_t %w %b

sd0
sd1

0.2
0.0

0.3
0.0

6.9
0.0

9.1 0.0 0.0


0.0 0.0 0.0

18.5
0.0

0
0

0
0

sd2

0.0

0.0

0.0

0.0 0.0 0.0

0.1

sd3

0.0

0.0

0.0

0.0 0.0 0.0

0.0

sd4
sd5

0.0
0.0

0.0
0.0

0.0
0.0

0.0 0.0 0.0


0.0 0.0 0.0

0.0
0.0

0
0

0
0

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

4/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

The extended statistics shows some extra info such as


reads/sec (r/s), writes/sec (w/s), kilobytes read and kilobytes
write per sec (kr/s and kw/s), avg. active transactions (actv),
average service time (svc_t) etc.

Per partition statistics


with the -p option we can also print the per partition io
statistics if we want.
Example 9
# iostat -xpn 1 10
extended device statistics
r/s
0.2

w/s
0.3

kr/s
6.8

kw/s wait actv wsvc_t asvc_t %w %b device


9.0 0.0 0.0
0.0
18.5
0
0 c8t0d0

0.0

0.0

0.0

0.0 0.0 0.0

0.0

0.0

0 c8t0d0s0

0.2

0.3

6.8

9.0 0.0 0.0

0.0

19.9

0 c8t0d0s1

0.0

0.0

0.0

0.0 0.0 0.0

0.0

0.0

0 c8t0d0s8

Error Statistics
To check for hard and soft errors on disk use the -e option
with iostat command :
Example 10
# iostat -en
---- errors --s/w h/w trn tot device
0

0 c8t0d0

0 c8t1d0

0
0

0
0

0
0

0 c7t0d0
0 c8t2d0

0 c8t3d0

0 c8t4d0

The various errors are :


Soft e rror : A disk sector fails the CRC check and needs
to be re-read
Hard e rror : Re-read fails several times for CRC check
Transport e rror : Errors reported by I/O bus
Total e rrors : Soft error + Hard error + Transport errors
The various errors statistics can also be displayed with -E
http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

5/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

option :
Example 11
# iostat -E
sd0

Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

Vendor: VMware, Product: VMware Virtual S Revision: 1.0 Serial No:


Size: 10.74GB <10737418240 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 9 Predictive Failure Analysis: 0
sd1

Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

Vendor: VMware, Product: VMware Virtual S Revision: 1.0 Serial No:


Size: 24.70GB <24696061952 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 6 Predictive Failure Analysis: 0

Combining multiple options


Now when using iostat, we usually combine 3 or 4 options to
give you only the output in which we are interested. As show
in below example we would only get non-zero lines, with
logical disk name, extended statistics etc by combining
various options in iostat example.
Example 12
# iostat -xntcz 1 3
tty
cpu
tin tout us sy wt id
0
5
0 1 0 99
r/s

w/s

0.1
0.0
tty

0.3
0.0

extended device statistics


kr/s
kw/s wait actv wsvc_t asvc_t %w %b device
6.1
0.0
cpu

17.3 0.0 0.0


0.0 0.0 0.0

0.0
0.0

20.8
0.1

0
0

0 c8t0d0
0 c7t0d0

tin tout us sy wt id
0 313
0 62 0 38
extended device statistics
r/s
0.0

w/s
54.7

kr/s
kw/s wait actv wsvc_t asvc_t %w %b device
0.0 50579.8 0.0 5.7
0.2 104.5
1 68 c8t0d0

tty
cpu
tin tout us sy wt id
0 288
0 35 0 65
r/s
w/s
0.0 164.4

extended device statistics


kr/s
kw/s wait actv wsvc_t asvc_t %w %b device
0.0 36788.5 0.0 5.1
0.0
31.0
0 68 c8t0d0

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

6/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

Related Posts
1. Solaris Performance troubleshooting : Disk (I/O)
performance issues
2. Solaris ZFS command line reference (Cheat sheet)
3. Examples of adding VxFS, ZFS, SVM, UFS, lofs, Raw
volumes and disk devices to non-global zones.
4. 17 Examples of using Solaris boot command

Filed Under: Performance, Solaris 10, Solaris 11

Share Your Comments &


Feedback:
Name *

Email *

Website

Comment

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

7/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

SUBMIT

GET YOUR FREE E-BOOK


Sign-up to Download the FREE ebook The Complete Oracle Hardware reference.

Enter your email address...

DOWNLOAD

FIND ME ON GOOGLE+
Sandeep P
Follow
34 followers

Find us on Facebook

Thegeekdiary
Like

90 people like Thegeekdiary.

Facebook social plugin

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

8/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

CATEGORIES
Hardware (16)
Interview Questions (1)
LDOMs (9)
Linux (3)
Performance (2)
scripting (2)
Solaris 10 (41)
Solaris 11 (40)
Storage (3)
SVM (3)
VCS (12)
VxVM (7)
ZFS (5)
Zones (9)

FOLLOW US ON SOCIAL MEDIA


Follow me on Google +
Follow Me on twitter
Like TheGeekDiary on Facebook
Connect me on LinkedIn
GEEK BEHIND THEGEEKDIARY
India based Unix Admin, Cloud
Evangelist and a Virtualization
lover. I am Sandeep Patil. I work as
a Unix Administrator and love playing around
http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

9/10

3/7/2014

12 iostat examples for Solaris performance troubleshooting

with Solaris and various other virtualization and


HA solutions. Read More
View My Blog Posts
RECENT COMMENTS
Sandeep Patil on Examples of adding static
routes in Solaris
Raja on Examples of adding static routes in
Solaris
Sandeep Patil on How to install and configure
LDOMs (Oracle VM for SPARC)

Copyright 2014 The Geek Diary Contact US Archive

http://thegeekdiary.com/12-iostat-examples-for-solaris-performance-troubleshooting/

10/10

Potrebbero piacerti anche