Wednesday, February 10, 2010

Linux Hard Drive Performance measurements

Many people trust vendor specs, moreover they trust hard drive speed, disk controller speed and so on. However, reality is that you will never get those specs when you set up the hardware. Why? Vendors test their hardware on special environments, with specific combination of hardware.

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.

3 comments:

Aside from the hdparm command, none of these require root authority and they should NOT be performed while logged in as root or executing within an su(1) environment.

In addition, interested readers will Google for it, but I like bonnie++ and iozone, each for different reasons. With a RHEL5 kernel (or similar) you can also use SystemTap to monitor activities anywhere within the system. Once such example is blktrack (I think that's the name).

bonnie++ is nice but it is out of date...iozone is also really great, easy to install (available on repos), however it is a little complex. I suggest these tools because are really easy to use and they can give you an idea of how a new HW is behaving.