Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup a web application on the Azure Preview Portal. I've created a Linux Centos 6.2 machine from the Azure VM gallery and attached some disks to it.

df -h gives me this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       28G  4.2G   22G  16% /
tmpfs                 1.7G     0  1.7G   0% /dev/shm
/dev/sda1             485M   94M  366M  21% /boot
/dev/sdb1             133G  188M  126G   1% /mnt/resource
/dev/sdc1              40G  176M   38G   1% /mnt/datadrive

sdb1 and sdc1 are both storage drives. sdb1 is the default one created when you create the machine and sdc1 was attached by me as another 40GB drive.

I want to test the performance of each drive and compare it with the boot drive (that is probably sda1).

I've tried using dd for it:

dd if=/dev/sda1 of=/tmp/zero bs=1k count=100k // test for sda1
dd if=/dev/sdb1 of=/tmp/zero bs=1k count=100k // test for sdb1
dd if=/dev/sdc1 of=/tmp/zero bs=1k count=100k // test for sdc1

But I'm not sure if it actually does the test in different partition in each run. Is this a correct way to test the read/write of different partitions ? thanks.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

While dd can be a useful tool it's also important to remember the possibility that you're testing a file that has already been cached. In NFS environments we've gone so far as to unmount and remount partitions between test iterations to make sure we were definitively hitting the server rather than relying on something local.

share|improve this answer

You would better use some more specific tools for test disk speeds, like bonnie++ or iometer. They will give you more detailed information than a pure dd.

share|improve this answer

DD can provide some insight in this fashion, however the method that you are using can be improved on.

You need to be sure that either the source or destination doesn't have a physical drive backing it, otherwise you potentially get performance characteristics which include both elements.

My suggestion would be to use the following commands to test performance.

With the destination disk mounted under /mnt/sdb1

dd if=/dev/zero of=/mnt/sdb1/image_file bs=1k count=...

With the source disk unmounted.

dd if=/dev/sdb1/image_file of=/dev/null bs=1k count=...

This should create a large file consisting of only the null character. This is fairly safe to perform on any disk, including your root if you have the space.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.