Wednesday, February 29, 2012

How to check I/O speeds

While working on a VMware ESX image, I came across this situation that it was working really well when hosted on Datastore1. However, if I moved it to Datastore2, the response of the image became very poor.
Since the VMware ESX machine was same, it was abundantly clear there was something wrong with Datastore2. Unfortunately VMware ESX doesn't seem to complaint if the I/O speeds degrade - atleast I am not aware of this. So the only way to find out was by testing the I/O speeds seen by the VMware Image.
The tool I used is a pretty familiar one in Linux world - dd. Here's what you do:

Image is on Datastore1
Step 1: Login to your linux machine
Step 2: Run this command on shell `dd if=/dev/zero of=/dev/null& pid=$!`
Step 3: Run this command after few seconds `kill -USR1 $pid; sleep 1; kill $pid`

You'll see an output like this below. Pay attention to the last line.

[root@mylinux ~]# dd if=/dev/zero of=/dev/null& pid=$!
[1] 10055
[root@mylinux ~]# kill -USR1 $pid; sleep 1; kill $pid
23469330+0 records in
23469329+0 records out
12016296448 bytes (12 GB) copied, 11.711 s, 1.0 GB/s

Repeat the above steps on Datastore2.

[root@mylinux ~]# dd if=/dev/zero of=/dev/null& pid=$!
[1] 4430
[root@mylinux ~]# kill -USR1 $pid; sleep 1; kill $pid
11572320+0 records in
11572319+0 records out
5925027328 bytes (5.9 GB) copied, 10.962 seconds, 541 MB/s

As you can see the I/O speed on Datastore2 is 541 MB/s against 1GB/s on Datastore1. Hence I was seeing degraded performance on Datastore2.

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home