I was evaluating Azure and it appears the Ubuntu VM I created has unexpectedly low disk performance. I noticed this because the database import took much longer compare to another Rackspace VM I'm using. And I'm not sure whether there is any important configurations that I missed or is it just I'm looking at the disk performance in the wrong way. Here are my tests and the results:
Standard A1 VM (1 core, 1.75GB memory, Ubuntu 12.04 LTS)
- sudo hdparm -tT /dev/sdb:
- Timing cached reads: 6892 MB in 2.00 seconds = 3451.31 MB/sec
- Timing buffered disk reads: 40 MB in 3.37 seconds = 11.88 MB/sec
- sudo hdparm -t --direct /dev/sdb:
- Timing O_DIRECT disk reads: 46 MB in 3.74 seconds = 12.29 MB/sec
- sudo dd if=/dev/zero of=/mnt/test bs=8k count=200000; sudo rm -f /mnt/test:
- 1638400000 bytes (1.6 GB) copied, 246.32 s, 6.7 MB/s
- 1638400000 bytes (1.6 GB) copied, 246.32 s, 6.7 MB/s
- sudo hdparm -tT /dev/xvda:
- Timing cached reads: 5960 MB in 1.99 seconds = 2990.32 MB/sec
- Timing buffered disk reads: 200 MB in 3.05 seconds = 65.66 MB/sec
- sudo hdparm -t --direct /dev/xvda:
- Timing O_DIRECT disk reads: 162 MB in 3.12 seconds = 52.00 MB/sec
- sudo dd if=/dev/zero of=test bs=8k count=200000; sudo rm -f test:
- 1638400000 bytes (1.6 GB) copied, 13.7139 s, 119 MB/s
As comparison, my other VM on Rackspace (4 vCPU, 1GB memory, Ubuntu 12.04 LTS)has the following results:
Although the Azure VM has better cached read performance, its disk read (both buffered and direct) is quite slow, and disk write (or copy) is way worse. I manually created a 5GB swap file on the /dev/sdb partition, but it does not seem to be helpful in any way.
Then I did one more around of testing on Azure using a Standard D3 VM (4 cores, 14GB memory, Ubuntu 12.04 LTS). When executing the commands above on /dev/sdb the performance was amazing, I guess because of local SSD? However when I attach an additional disk to that D3 VM and run the same commands on the newly created /dev/sdc partition (ext4), the results are just as bad as the A1 instance.
Not sure if this is the best way to test disk performance in Linux, but it is pretty noticeable that the Azure VM is much slower when restoring database backup. Any comments is welcomed.