Monday, February 15, 2010

File system benchmarking.

A simple file system benchmarking can use dd e.g. creating 100M file on /mnt/iscsi: "dd if=/dev/zero of=/mnt/iscsi/file bs=1024k count=100"
But dd can only measure sequential write/read and as being single thread, it is not powerful enough to overload fast disks.

My experience in file system benchmarking
1. Avoiding file cache effect.
2. Check disk %util from iostat -x command to make sure the load is hevy enough to saturate the disk
3. Run the same test many times to get average value
4. Run with different testing tools if values from one tool are doubtful
There are many File system benchmarking avaiable e.g. bonnie , iozone , fileio, tiobench ...

Bonnie
#simple to use, But doesn't support many options e.g block size, testing type, multiple threads. #Sample: Testing by creating 64M file on dir /mnt/iscsi
[root@centos ~]# bonnie -s 64 -d /mnt/iscsi
Bonnie: Warning: You have 251MB RAM, but you test with only 64MB datasize!
Bonnie: This might yield unrealistically good results,
Bonnie: for reading and seeking and writing.
Bonnie 1.4: File '/mnt/iscsi/Bonnie.1968', size: 67108864, volumes: 1
Writing with putc()... done: 61897 kB/s 48.1 %CPU
Rewriting... done: 569898 kB/s 47.0 %CPU
Writing intelligently... done: 288998 kB/s 31.3 %CPU
Reading with getc()... done: 55108 kB/s 38.1 %CPU
Reading intelligently... done: 1524163 kB/s 97.7 %CPU
Seeker 1...Seeker 2...Seeker 3...start 'em...done...done...done...
---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek-
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)-
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
centos 1* 64 61897 48.1288998 31.3 569898 47.0 55108 38.11524163 97.7 110628.6 74.7

iozone

#feature rich: options for block size, test type, multiple threads and export output to Excel file format for graphing.
#Sample Test. Run a test by writing 64M file to /mnt/iscsi ; record size is 4k;
#test types are 0=write/rewrite, 1=read/re-read, 2=random-read/write



[root@centos ~]#cd /mnt/iscsi; iozone -s 64M -r 4k -i 0 -i 1 -i 2
Iozone: Performance Test of File I/O
Version $Revision: 3.315 $
Compiled for 32 bit mode.
Build: linux

Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy,
Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root.

Run began: Mon Feb 15 12:14:05 2010

File size set to 65536 KB
Record Size 4 KB
Command line used: iozone -s 64M -r 4k -i 0 -i 1 -i 2
Output is in Kbytes/sec
Time Resolution = 0.000002 seconds.
Processor cache size set to 1024 Kbytes.
Processor cache line size set to 32 bytes.
File stride size set to 17 * record size.
random random bkwd record stride
KB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread
65536 4 894127 2272316 39813119 53847589 9302484 639088

iozone test complete.

#Output result to Excel file


iozone -Rb perf.xls -s 64M -r 4k -i 0 -i 1 -i 2

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.