Factors for Disk Performance
df -k command
How to use df
#> df
capacity : How much of the file system's total capacity has been used
How to read df output
¢º %capacity = 100%
=> remove core and any s/w packages
=> add more disk space or move files to another partition
Example of df
#> df -k
Filesytem
kbytes used avail
capacity Mounted on
/dev/dsk/c0t3d0s0 21615 14909 4546
77% /
/dev/dsk/c0t3d0s6 240463 211348
5075 98% /usr
/proc
0
0 0
0% /proc
iostat command
How to use iostat
#> iostat 5
disk
serv : average service time, in milliseconds
cpu
us : time spent in user mode
sy : time spent in system mode
wt : time spent waiting I/O
#> iostat -x 5
svc_t : service time
w% : percentage of time the queue is not empty
%b : percentage of time the disk busy
How to read iostat -x output
¢º %b
5% > %b : ignore
30% < %b : be concerned about anything
60% < %b : need fixing
¢º svc_t
if %b < 5%, svc_t : ignore
if %w has values, 10 - 50ms : OK
100 - 150 : Need fixing
iostat -D command
How to use iostat -D
#> iostat -D 5
util : percentage of disk utilization
We can find the load balance between disks.
Example of iostat
#> iostat
5
tty
fd0
sd0
sd1
sd2
cpu
tin tout Kps tps serv Kps
tps serv Kps tps serv Kps tps serv us sy wt id
0 560
0 0 0 0 0
99 1 0 49 10 2
54 4 4 4 88
0 16
0 0 0 0 0
0 0 0 0
0 0 0 0 0 0
99
#> iostat -x
5
extended
disk statistics
disk 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
sd0 0.0 0.0 0.2 0.1 0.0 0.0 99.5
0 0
#> iostat
-D
fd0
sd0
sd1
sd2
rps wps util rps
wps util rps wps util rps wps util
0 0 0.0
0 0 0.2 0 0 0.4
1 0 3.1
sar -a -b -d command
How to use sar
#> sar -a 5 3
-a : Report use of file access system routines (report on file access)
iget/s
namei/s
dirbk/s
Average
#> sar -b 5 3
-b : Report buffer activity (report on disk buffers)
%rcache : Fraction of logical reads found in the system buffers
%wcache : Fraction of logical writes found in the system buffers
#> sar -d 5 3
-d : Report activity for each block device (report on disk transfers)
r+w/s : read + write per second
%busy : Percentage of time the device spend servicing a transfer
blk/s : Number of 512-byte blocks transferred to device, per second
How to read sar data
sar -a
¢º The large the values, the more time the kernel is spending to ACCESS user files
¢º This report is USEFUL for understanding "HOW disk-dependent a system is"
sar -b
¢º %rcache < 90% and %wcache < 65%
=> may be possible to improve performance by increasing the buffer space
sar -d
¢º %busy > 85% : high utilization, load problem
¢º r+w/s > 65% : overload
Example of sar output
#> sar -a 5 3
16:59:36
iget/s namei/s dirbk/s
16:59:41 0
0
0
16:59:46
8 26
15
16:59:51 271
297 288
Average
93 108
101
#> sar -b 5 3
16:59:36 bread/s
lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s
16:59:41
19 57
67 22
26 17
0
0
16:59:46
23 73
69 18
23 20
0
0
16:59:51
25 51
51 15
27 46
0
0
Average
22 60
63 18
25 28
0
0
#> sar -d 5 3
13:21:07
device %busy avque r+w/s blks/s avwait avserv
13:21:12 sd1
52 0.8 30
216 4.8
21.1
sd3
6 0.1
1 14 0.0
45.4
average
sd1 32 0.5 17
187 3.5
23.9
sd2
45 0.4
24 208 0.0 18.9
sd3 4 0.0
1 9 0.0
51.1
DISK Solutions
1st. Check the file system overload (above 90 or 95% capacity)
=> Clean out unused files from /va/adm, /var/adm/sa and /var/lp/logs.
=> Clean out the core files.
=> Find the files what are unused more than 60 days.
#> find /home -type f pmtime +60 -print
#> find /home -name core -exec rm {}\;
2nd. If you have more than one disks,
=> Distribute the file systems for a more balanced load between the disks.
=> Try reducing disk seeking through careful planning in data positioning on disk.
(I/O on the outer sectors can be far faster)
3rd. Consider adding Memory.
=> Additional memory reduces swapping and paging, and allows an expanded buffer pool.
4st. Consider buying faster disks.
5st. Make sure disks are not overloading SCSI controller.
=> Below 60% utilization of SCSI bus.
6st. Consider adding disks.
=> Not be busier more than 40 - 60% of the time.
(%b : iostat -xct 5 and %busy : sar -d 5 3)
7st. Considering using an in-memory file system for /tmp directory.
=> It's default in Solaris 2.X.