Skip to content

Commit f281444

Browse files
committed
new fio.sh to better handle raw devices
use "size=" for raw devices parse multiple raw devices when genrating dtrace code
1 parent 55b84c7 commit f281444

File tree

2 files changed

+77
-66
lines changed

2 files changed

+77
-66
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,53 @@ There three graphs
277277
are in the right hand axis legend in top graph the latency on log scale
278278

279279
see: https://sites.google.com/site/oraclemonitor/i-o-graphics#TOC-percentile-latency-with-scaling
280+
281+
282+
New Graphics
283+
-----------------------------------------------------
284+
a new version of the function graphit() is created by
285+
fiop.r and fiopg.r will go through a set of I/O data
286+
and print out variouis graphs of the data.
287+
Examples of the graphs are on
288+
https://plus.google.com/photos/105986002174480058008/albums/5773655476406055489?authkey=CIvKiJnA2eXSbQ
289+
290+
A visual explanation is here
291+
https://plus.google.com/photos/105986002174480058008/albums/5773661884246310993
292+
293+
A Summary of the graph contents is:
294+
295+
The charts are mainly for exploring the data as opposed to a polished final graph showing I/O performance
296+
297+
A quick recap of the graphics:
298+
There are 3 graphs
299+
300+
1. latency on log graph
301+
2. latency on base 10 graph
302+
3. throughput bar charts
303+
304+
On the log latency graph latency is shown for
305+
306+
* max latency - dashed red line
307+
* average latency - solid black line
308+
* 95% latency - dash black line with grey fill between 95% and average
309+
* 99% latency - dash black line with light grey fill between 95% and 99% latency
310+
* latency histogram - buckets represent % of I/Os for that latency.Each bucket is drawn at the y axis height that represents that latency. The buckets are also color coded to help more quickly identify
311+
* background color - for each load test the background is coded one of 3 colors.
312+
* ... yellow - % of I/Os over 10ms
313+
* ... green - % of I/Os under 10ms
314+
* ... blue - % of I/Os under 1ms
315+
316+
the idea being that the graphs should have all green. If the backgrounds are yellow then the I/Os are slow. If the backgrounds are blue then the I/Os represent a certain about of cached reads as opposed to physical spindle reads.
317+
318+
319+
The second graph is latency on base 10 in order to more easily see the slopes of the increasing I/O latency with load.
320+
On this second graph is also a bar chart in the background. The bars are color coded
321+
322+
* dark red - latency increased and throughput decreases
323+
* light red - latency increased but throughput also increased
324+
* light blue - latency actually got faster (shouldn't happen but does)
325+
326+
Ideally the bars are so small they aren't visible which means latency stays the same as load increases. The higher the bar the more the latency changed between tests
327+
328+
The third chart is simply the throughput, ie the MB/s. These bars have slices that represent the percentage of the I/O at the latency that corresponds to that color. The colors are defined in the legend of the top chart.
329+

fio.sh

Lines changed: 27 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
#
44
# DIRECT I/O :
55
#
6-
# direct I/O is used except on ZFS
7-
# DelphixOS uses ZFS
8-
# thus
96
# direct is set to 0 if it's detected that fio.sh is running on Delphix
10-
# environment variable FDIO=1 will force direct=1 when running on Delphix O/S
7+
# environment variable FDIO=1
8+
# will direct=1 ven when trunning on Delphix O/S
119
# direct=1 doesn't seem to work on opensolaris even
1210
# when opensolaris is the NFS client
1311
#
@@ -25,11 +23,7 @@ SEEDFILE=fio_random.dat
2523

2624
DIRECT=1
2725
BINARY="./fio"
28-
if [ -f /etc/delphix/version ] ; then
29-
DIRECTORY="/domain0/fiotest"
30-
else
31-
DIRECTORY="./"
32-
fi
26+
DIRECTORY="/domain0/fiotest"
3327
OUTPUT="."
3428
TESTS="all"
3529
SECS="60"
@@ -42,7 +36,6 @@ CUSTOMBLOCKSIZE=-1
4236
FILE=fiodata
4337
FILENAME="filename=$FILE"
4438
RAW=0
45-
NOZFS=0
4639

4740
DTRACE1=""
4841
DTRACE2=""
@@ -83,14 +76,13 @@ OPTIONS:
8376
-u #users force test to only use this many users
8477
-l blocksize force test to only use this blocksize in KB, ie 1-1024
8578
-e recordsize use this recordsize if/when creating the zfs file system, default 8K
86-
-z turn off default ZFS setup, ie creating a domain etc
8779
8880
example
8981
fio.sh ./fio.opensolaris /domain0/fiotest -t rand_read -s 10 -m 1000 -f
9082
EOF
9183
}
9284

93-
while getopts hb:r:ce:d:o:it:s:l:u:m:fz OPTION
85+
while getopts hb:r:e:d:o:it:s:l:u:m:f OPTION
9486
do
9587
case $OPTION in
9688
h)
@@ -129,6 +121,7 @@ do
129121
;;
130122
m)
131123
MEGABYTES=$OPTARG
124+
echo "MEGABYTES=$MEGABYTES"
132125
MB=1
133126
;;
134127
f)
@@ -140,20 +133,14 @@ do
140133
t)
141134
TESTS=$OPTARG
142135
;;
143-
z)
144-
NOZFS=1
145-
;;
146136
?)
147137
usage
148138
exit
149139
;;
150140
esac
151141
done
152142

153-
#
154-
# BEGIN {
155-
# DTRACE SCRIPT GENERATION FUNCTIONS
156-
#
143+
157144

158145
dtrace_begin()
159146
{
@@ -188,8 +175,10 @@ dtrace_luns_raw()
188175
{
189176
#j=`readlink -f $RAWNAME`
190177
# output will have ",raw" at the end, but DTrace matching is without the ",raw"
191-
j=`readlink -f $RAWNAME | sed -e 's/,raw/'/`
192-
echo "lun[\"$j\"] = 1;"
178+
for rawdev in `echo $RAWNAME | sed -e 's/:/ /'`; do
179+
j=`readlink -f $rawdev | sed -e 's/,raw/'/`
180+
echo "lun[\"$j\"] = 1;"
181+
done
193182
}
194183

195184
dtrace_end()
@@ -277,45 +266,36 @@ offsets()
277266
done
278267
}
279268

280-
#
281-
# DTRACE SCRIPT GENERATION FUNCTIONS
282-
# END }
283-
#
284-
285-
#
286-
# CUSTOM WORKFILE SETUP
287-
#
269+
# if there is no filename specified
270+
# then fio will use a file per processes
271+
# instead of a single file
272+
# the filenames will be generated
273+
# each generated file will get the same size
288274
if [ x$FILENAME == x ] ; then
289275
SIZE="size=100m"
290276
if [ x$MB == x1 ]; then
291-
SIZE="size=${MEGAYTES}m"
277+
SIZE="size=${MEGABYTES}m"
292278
fi
293279
OFFSET=0
294280
fi
281+
if [ $RAW -eq 1 ] ; then
282+
SIZE="size=${MEGABYTES}m"
283+
fi
295284

296285

297-
#
298-
# OUTPUT DIRECTORY SETUP
299-
#
300286
mkdir $OUTPUT > /dev/null 2>&1
301287
if [ ! -d $OUTPUT ]; then
302288
echo "directory $OUTPUT does not exist"
303289
exit
304290
fi
305291

306-
#
307-
# DELPHIX OS DETECTION
308-
#
309292
if [ -f /etc/delphix/version ] ; then
310293
DIRECT=0
311294
# if running on Delphix, then collect DTrace I/O info
312295
DTRACE1=" sudo dtrace -c ' "
313296
DTRACE2=" ' -s fio.d "
314297
fi
315298

316-
#
317-
# DEFINE TESTS TO RUN
318-
#
319299
all="randrw read write readrand"
320300
all="readrand write read "
321301
if [ $TESTS = "all" ] ; then
@@ -325,6 +305,7 @@ else
325305
fi
326306

327307
DIRECT=${FDIO:-$DIRECT}
308+
328309
echo "configuration: "
329310
echo " binary=$BINARY"
330311
echo " work directory=$DIRECTORY"
@@ -339,22 +320,13 @@ echo " recordsize =$RECORDSIZE"
339320
echo " filename (blank if multiple files)=\"$FILENAME\""
340321
echo " size per file of multiple files=\"$SIZE\""
341322

342-
343-
#
344-
# ZFS SETUP
345-
#
346-
# if running on DELPHIX, set up ZFS files system
347-
# (this options could be made a command line flag
348-
# for other systems that might want to test ZFS)
349-
#
350-
# if running on DELPHIX and not using RAW devices
351-
# and NOZFS has not been set
352-
if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] && [ $NOZFS -eq 0 ]; then
323+
if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] ; then
353324
if [ -f fio.d ]; then
354325
if [ ! -f fio.d ]; then
355326
mv fio.d fio.d.orig
356327
fi
357328
fi
329+
358330
# DIRECTORY=/domain0/fiotest
359331
FILESYSTEM=`echo $DIRECTORY | sed -e 's;^/;;' `
360332
DOMAIN=`echo $FILESYSTEM | sed -e 's;/.*;;' `
@@ -427,10 +399,6 @@ if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] && [ $NOZFS -eq 0 ]; then
427399
cat $OUTPUT/setup.txt | grep -v PROPERTY | sed -e 's/^/ /'
428400
fi
429401

430-
431-
#
432-
# DIRECTORY to create I/O test file
433-
#
434402
if [ ! -d $DIRECTORY ]; then
435403
echo "directory $DIRECTORY does not exist"
436404
exit
@@ -444,10 +412,6 @@ if [ $FORCE = "n" ] ; then
444412
fi
445413
fi
446414

447-
#
448-
# DTRACE SETUP
449-
# (should be added as a command line option)
450-
#
451415
if [ -f /etc/delphix/version ] ; then
452416
dtrace_begin > fio.d
453417
if [ $RAW == 1 ] ; then
@@ -467,14 +431,12 @@ if [ -f /etc/delphix/version ] ; then
467431
fi
468432

469433

470-
#
471-
# CREATE FILE for I/O tests
472-
#
434+
473435
if [ ! -f $DIRECTORY/$FILE ] || [ $CREATE == 1 ]; then
474436
# tar cvf - /opt/delphix/server > /domain0/fiotest/fiodata
475-
if [ $RAW == 0 ] ; then # BEGIN NOT RAW DEVICE {
437+
if [ $RAW == 0 ] ; then
476438
echo "CREATE=$DIRECTORY/$FILE"
477-
if [ -f $SEEDFILE ] ; then # BEGIN SEEDFILE {
439+
if [ -f $SEEDFILE ] ; then
478440
echo "seed file found, using $SEEDFILE"
479441
loops=0
480442
while [[ $loops -le $MEGABYTES ]] ; do
@@ -510,13 +472,12 @@ fi
510472
done
511473
rm dd.out.$$
512474
rm /tmp/fio.$$
513-
fi # } END SEEDFILE
475+
fi
514476
echo
515477
echo "file creation finished"
516-
fi # } END NOT RAW DEVICE
478+
fi
517479
fi
518480

519-
520481
if [ $RAW -eq 0 ]; then
521482
cmd="ls -l $DIRECTORY/$FILE "
522483
echo "running "

0 commit comments

Comments
 (0)