I was trying to set up a server with fast access to hard drives so I did a little research of how to test different configuration of hard drives. These are my findings:
Note: All these tests should be executed several times. The real results are affected by hard drive cache, controller cache, and operative system cache.
1- (Read Speed) hdparm -t /dev/sda
This is a very well known command that It can give you the max read speed (sequential).
2- (Write Speed) dd count=1k bs=10M if=/dev/zero of=/data/test.img
This is another well known command that It can give you an average of writes.
This command creates a 10G file and measure the speed.
3- (Write speed) This people http://www.nlanr.net/Dskwtst/ created a C program that logs write speed.
#wget http://www.nlanr.net/Dskwtst/Software/dskwtst.c
#gcc -O2 dskwtst.c -o dskwtst
(Compiling probably you would get an error)
dskwtst.c: In function âmainâ:
dskwtst.c:32: warning: incompatible implicit declaration of built-in function âexitâ
This error is only a warning so it should not affect results.
#./dskwtst > /data/ouputfile 2> ./log
The command will create a file on /data/ and it will send the results to log.
4- (Random access)This guy http://www.linuxinsight.com/how_fast_is_your_disk.html created a C program that can measure the seek time of the hard drive.
#wget http://www.linuxinsight.com/files/seeker.c
#gcc -O2 seeker.c -o seeker
#./seeker /dev/sda
Enjoy it ...


3 comments: