Skip to content

Commit 29d16a0

Browse files
committed
add noZFS option to fio.sh, improved fioparse.sh output
fioparse.sh no prompts for test name when outputting R format fiog.r also creates PNG files with and without histograms overlaid
1 parent 3af48a4 commit 29d16a0

File tree

5 files changed

+185
-35
lines changed

5 files changed

+185
-35
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There are a lot of I/O benchmarking tools out there, most noteably
88
iozone and bonnie++, but fio seems to be the most flexible with
99
the most active user community
1010

11-
* project: http://freecode.com/projects/fio
11+
* fio project: http://freecode.com/projects/fio
1212
* download: http://brick.kernel.dk/snaps/fio-2.0.7.tar.gz
1313
* man page: http://linux.die.net/man/1/fio
1414
* how to: http://www.bluestop.org/fio/HOWTO.txt
@@ -32,7 +32,7 @@ Running fio.sh
3232
---------------------------
3333
First run fio.sh.
3434
The script fio.sh will run a series of I/O benchmarks.
35-
The series of I/O benchmarks is aimed at simulating the typical workload
35+
The series of I/O benchmarks are aimed at simulating the typical workload
3636
of an Oracle database.
3737
There are 3 types of I/O run
3838

data_mem.r

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
m <- NULL
2+
m <- matrix(c(
3+
"read", 1, "8K",1130.700, 0.006, 0.0, 0, 0.0,144716 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.006,0.008,0.009,0.015,0.021,0.048
4+
, "read", 1, "32K",1843.300, 0.016, 0.0, 0, 0.0,58983 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.017,0.024,0.026,0.046,0.059,0.133
5+
, "read", 1,"128K",2084.100, 0.058, 0.1, 0, 0.0,16679 , 0,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.061,0.074,0.076,0.097,0.123,0.187
6+
, "read", 1, "1M",2236.300, 0.445, 0.4, 4, 0.0, 2236 , 0, 0, 0,98, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.474,0.502,0.524,0.620,0.700,1.336
7+
, "read", 8, "1M",7154.200, 0.689, 0.3, 328, 3.7, 7154 , 0, 0, 0, 2,97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.612,0.700,0.884,50.944,84.480,166.912
8+
, "read", 16, "1M",7198.700, 1.190, 0.3, 760, 10.6, 7198 , 0, 0, 0, 0,97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.628,1.592,40.192,150.528,201.728,444.416
9+
, "read", 32, "1M",7491.100, 2.633, 0.3, 1670, 32.6, 7491 , 0, 0, 0, 2,96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.628,4.192,101.888,528.384,741.376,1187.840
10+
, "read", 64, "1M",7466.300, 7.885, 0.3, 1570, 76.8, 7466 , 0, 0, 0, 1,96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.644,160.768,790.528,1056.768,1138.688,1400.832
11+
,"randread", 1, "8K", 967.246, 0.006, 0.0, 2, 0.0,123807 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.007,0.009,0.011,0.021,0.026,0.068
12+
,"randread", 8, "8K",3845.600, 0.014, 0.0, 520, 1.0,492223 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.008,0.010,0.012,0.036,0.065,0.233
13+
,"randread", 16, "8K",3664.300, 0.030, 0.0, 840, 2.6,469022 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.008,0.009,0.011,0.038,0.076,40.192
14+
,"randread", 32, "8K",3702.300, 0.057, 0.0, 1163, 5.2,473892 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.008,0.009,0.011,0.038,0.070,110.080
15+
,"randread", 64, "8K",3697.600, 0.116, 0.0, 1770, 9.7,473288 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.008,0.010,0.012,0.038,0.074,651.264
16+
, "write", 1, "1K", 210.374, 0.003, 0.0, 0, 0.0,215423 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.003,0.004,0.004,0.009,0.015,0.027
17+
, "write", 1, "8K",1056.500, 0.006, 0.0, 0, 0.0,135230 ,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.006,0.007,0.009,0.018,0.024,0.064
18+
, "write", 1,"128K",1871.800, 0.065, 0.1, 3, 0.0,14973 , 0,99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.064,0.081,0.100,0.159,0.163,0.211
19+
, "write", 4, "1K", 102.471, 0.026, 0.0, 60, 0.1,104930 ,98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.039,0.050,0.057,0.079,0.096,0.237
20+
, "write", 4, "8K", 523.658, 0.042, 0.0, 180, 0.4,67028 ,81,18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.056,0.067,0.106,2.576,4.048,8.768
21+
, "write", 4,"128K",1719.500, 0.214, 0.1, 220, 1.3,13755 , 0, 0,83,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.286,0.310,0.374,8.384,8.768,47.360
22+
, "write", 16, "1K", 86.771, 0.097, 0.0, 700, 3.6,88854 ,60,25,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.131,0.209,0.241,0.298,0.580,179.200
23+
, "write", 16, "8K", 472.522, 0.136, 0.0, 1190, 4.9,60482 ,38,42,19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.157,0.237,0.243,1.304,10.688,220.160
24+
, "write", 16,"128K",1581.000, 0.678, 0.1, 1620, 13.1,12648 , 0, 0,44,41,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0.748,0.844,0.924,96.768,301.056,522.240
25+
),nrow=31)
26+
tm <- t(m)
27+
m <-tm
28+
colnames <- c("name","users","bs","MB","lat","min","max","std","iops"
29+
, "us50","us100","us250","us500","ms1","ms2","ms4","ms10","ms20"
30+
, "ms50","ms100","ms250","ms500","s1","s2","s5"
31+
,"p95_00", "p99_00", "p99_50", "p99_90", "p99_95", "p99_99"
32+
)
33+
colnames(m)=colnames
34+
m <- data.frame(m)
35+
36+
testtype <- "tmp"
37+

fio.sh

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
#
44
# DIRECT I/O :
55
#
6+
# direct I/O is used except on ZFS
7+
# DelphixOS uses ZFS
8+
# thus
69
# direct is set to 0 if it's detected that fio.sh is running on Delphix
7-
# environment variable FDIO=1
8-
# will direct=1 ven when trunning on Delphix O/S
10+
# environment variable FDIO=1 will force direct=1 when running on Delphix O/S
911
# direct=1 doesn't seem to work on opensolaris even
1012
# when opensolaris is the NFS client
1113
#
@@ -76,13 +78,14 @@ OPTIONS:
7678
-u #users force test to only use this many users
7779
-l blocksize force test to only use this blocksize in KB, ie 1-1024
7880
-e recordsize use this recordsize if/when creating the zfs file system, default 8K
81+
-z turn off default ZFS setup, ie creating a domain etc
7982
8083
example
8184
fio.sh ./fio.opensolaris /domain0/fiotest -t rand_read -s 10 -m 1000 -f
8285
EOF
8386
}
8487

85-
while getopts hb:r:e:d:o:it:s:l:u:m:f OPTION
88+
while getopts hb:r:ce:d:o:it:s:l:u:m:fz OPTION
8689
do
8790
case $OPTION in
8891
h)
@@ -132,14 +135,20 @@ do
132135
t)
133136
TESTS=$OPTARG
134137
;;
138+
z)
139+
NOZFS=1
140+
;;
135141
?)
136142
usage
137143
exit
138144
;;
139145
esac
140146
done
141147

142-
148+
#
149+
# BEGIN {
150+
# DTRACE SCRIPT GENERATION FUNCTIONS
151+
#
143152

144153
dtrace_begin()
145154
{
@@ -263,11 +272,14 @@ offsets()
263272
done
264273
}
265274

266-
# if there is no filename specified
267-
# then fio will use a file per processes
268-
# instead of a single file
269-
# the filenames will be generated
270-
# each generated file will get the same size
275+
#
276+
# DTRACE SCRIPT GENERATION FUNCTIONS
277+
# END }
278+
#
279+
280+
#
281+
# CUSTOM WORKFILE SETUP
282+
#
271283
if [ x$FILENAME == x ] ; then
272284
SIZE="size=100m"
273285
if [ x$MB == x1 ]; then
@@ -277,19 +289,28 @@ if [ x$FILENAME == x ] ; then
277289
fi
278290

279291

292+
#
293+
# OUTPUT DIRECTORY SETUP
294+
#
280295
mkdir $OUTPUT > /dev/null 2>&1
281296
if [ ! -d $OUTPUT ]; then
282297
echo "directory $OUTPUT does not exist"
283298
exit
284299
fi
285300

301+
#
302+
# DELPHIX OS DETECTION
303+
#
286304
if [ -f /etc/delphix/version ] ; then
287305
DIRECT=0
288306
# if running on Delphix, then collect DTrace I/O info
289307
DTRACE1=" sudo dtrace -c ' "
290308
DTRACE2=" ' -s fio.d "
291309
fi
292310

311+
#
312+
# DEFINE TESTS TO RUN
313+
#
293314
all="randrw read write readrand"
294315
all="readrand write read "
295316
if [ $TESTS = "all" ] ; then
@@ -299,7 +320,6 @@ else
299320
fi
300321

301322
DIRECT=${FDIO:-$DIRECT}
302-
303323
echo "configuration: "
304324
echo " binary=$BINARY"
305325
echo " work directory=$DIRECTORY"
@@ -314,13 +334,22 @@ echo " recordsize =$RECORDSIZE"
314334
echo " filename (blank if multiple files)=\"$FILENAME\""
315335
echo " size per file of multiple files=\"$SIZE\""
316336

317-
if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] ; then
337+
338+
#
339+
# ZFS SETUP
340+
#
341+
# if running on DELPHIX, set up ZFS files system
342+
# (this options could be made a command line flag
343+
# for other systems that might want to test ZFS)
344+
#
345+
# if running on DELPHIX and not using RAW devices
346+
# and NOZFS has not been set
347+
if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] && [ $NOZFS -eq 0 ]; then
318348
if [ -f fio.d ]; then
319349
if [ ! -f fio.d ]; then
320350
mv fio.d fio.d.orig
321351
fi
322352
fi
323-
324353
# DIRECTORY=/domain0/fiotest
325354
FILESYSTEM=`echo $DIRECTORY | sed -e 's;^/;;' `
326355
DOMAIN=`echo $FILESYSTEM | sed -e 's;/.*;;' `
@@ -393,6 +422,10 @@ if [ -f /etc/delphix/version ] && [ $RAW -eq 0 ] ; then
393422
cat $OUTPUT/setup.txt | grep -v PROPERTY | sed -e 's/^/ /'
394423
fi
395424

425+
426+
#
427+
# DIRECTORY to create I/O test file
428+
#
396429
if [ ! -d $DIRECTORY ]; then
397430
echo "directory $DIRECTORY does not exist"
398431
exit
@@ -406,6 +439,10 @@ if [ $FORCE = "n" ] ; then
406439
fi
407440
fi
408441

442+
#
443+
# DTRACE SETUP
444+
# (should be added as a command line option)
445+
#
409446
if [ -f /etc/delphix/version ] ; then
410447
dtrace_begin > fio.d
411448
if [ $RAW == 1 ] ; then
@@ -425,12 +462,14 @@ if [ -f /etc/delphix/version ] ; then
425462
fi
426463

427464

428-
465+
#
466+
# CREATE FILE for I/O tests
467+
#
429468
if [ ! -f $DIRECTORY/$FILE ] || [ $CREATE == 1 ]; then
430469
# tar cvf - /opt/delphix/server > /domain0/fiotest/fiodata
431-
if [ $RAW == 0 ] ; then
470+
if [ $RAW == 0 ] ; then # BEGIN NOT RAW DEVICE {
432471
echo "CREATE=$DIRECTORY/$FILE"
433-
if [ -f $SEEDFILE ] ; then
472+
if [ -f $SEEDFILE ] ; then # BEGIN SEEDFILE {
434473
echo "seed file found, using $SEEDFILE"
435474
loops=0
436475
while [[ $loops -le $MEGABYTES ]] ; do
@@ -466,12 +505,13 @@ fi
466505
done
467506
rm dd.out.$$
468507
rm /tmp/fio.$$
469-
fi
508+
fi # } END SEEDFILE
470509
echo
471510
echo "file creation finished"
472-
fi
511+
fi # } END NOT RAW DEVICE
473512
fi
474513

514+
475515
if [ $RAW -eq 0 ]; then
476516
cmd="ls -l $DIRECTORY/$FILE "
477517
echo "running "

fiog.r

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
11

2-
dir <- "C:\\Users\\Kyle\\Documents\\"
32
dir <- "C:\\Temp\\"
3+
poly=1
4+
hist=0
5+
6+
# graph writes by 3 user loads
7+
# for each user load graph the different blocksizes
8+
testname="write"
9+
for (users in c(1,4,16) ){
10+
file <- paste(testtype,testname,"users",users,sep="_")
11+
file <- paste(dir,file,".png",sep="")
12+
cat("file=",file,"\n")
13+
png(filename=file)
14+
graphit(m, i_name=testname, i_users=users,i_title=paste(testtype,testname,"users=",users),i_hist=hist,i_poly=poly)
15+
dev.off()
16+
}
17+
for (bs in c("1K","8K","128K") ){
18+
file <- paste(testtype,testname,"bs",bs,sep="_")
19+
file <- paste(dir,file,".png",sep="")
20+
cat("file=",file,"\n")
21+
png(filename=file)
22+
graphit(m, i_name=testname, i_bs=bs,i_title=paste(testtype,testname,"bs=",bs),i_hist=hist,i_poly=poly)
23+
dev.off()
24+
}
25+
26+
testname="randread"
27+
file <- paste(testtype,testname,"bs_8K",sep="_")
28+
file <- paste(dir,file,".png",sep="")
29+
cat("file=",file,"\n")
30+
png(filename=file)
31+
graphit(m, i_name=testname, i_bs="8K",i_title=paste(testtype,testname,"bs=8K"),i_hist=hist,i_poly=poly)
32+
dev.off()
33+
34+
testname="read"
35+
file <- paste(testtype,testname,"users_1",sep="_")
36+
file <- paste(dir,file,".png",sep="")
37+
cat("file=",file,"\n")
38+
png(filename=file)
39+
graphit(m, i_name=testname, i_users=1,i_title=paste(testtype,testname,"users=1"),i_hist=hist,i_poly=poly)
40+
dev.off()
41+
42+
file <- paste(testtype,testname,"bs_1M",sep="_")
43+
file <- paste(dir,file,".png",sep="")
44+
cat("file=",file,"\n")
45+
png(filename=file)
46+
graphit(m, i_name=testname, i_bs="1M",i_title=paste(testtype,testname,"bs=1M"),i_hist=hist,i_poly=poly)
47+
dev.off()
48+
49+
50+
# graphit(m, i_name="write", i_bs="128K",i_hist=1,i_poly=1,i_title="write bs=128K")
51+
52+
dir <- "C:\\Temp\\hist_"
453
poly=0
554
hist=1
655

0 commit comments

Comments
 (0)