Derick Bai
Derick Bai

Reputation: 25

Low disk performance in Ubuntu VM on Azure

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)

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

Timing O_DIRECT disk reads: 46 MB in 3.74 seconds = 12.29 MB/sec

1638400000 bytes (1.6 GB) copied, 246.32 s, 6.7 MB/s

As comparison, my other VM on Rackspace (4 vCPU, 1GB memory, Ubuntu 12.04 LTS) has the following results:

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

Timing O_DIRECT disk reads: 162 MB in 3.12 seconds = 52.00 MB/sec

1638400000 bytes (1.6 GB) copied, 13.7139 s, 119 MB/s

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. As Linux VM on Azure does not have swap file configured by default, I manually created a 5GB swap file (on /dev/sdb) but it does not seem to help.

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. Microsoft Azure support page suggests that we could ask question here with the "azure" tag, so ... Any comments is welcomed.

Upvotes: 1

Views: 2373

Answers (2)

bureado
bureado

Reputation: 149

D series are SSD based. Your /mnt or /mnt/resource on an A would also be SSD based and local to the server, but is not persistent. Cloud vendors have guidance on setting up striping or RAID0 (or 10) to increase IOPS. For Azure, I suggest taking a look at this guide that is designed for MySQL but covers from the disks up.

Upvotes: 0

Derick Bai
Derick Bai

Reputation: 25

I removed the disk that I attached to the Standard D3 VM earlier, then followed the same process and attached a new one. Somehow the newly attached disk has much better performance as showing below Standard D3 VM (4 cores, 14GB memory, Ubuntu 12.04 LTS)

  • sudo hdparm -tT /dev/sdc

Timing cached reads: 13054 MB in 1.99 seconds = 6546.15 MB/sec

Timing buffered disk reads: 68 MB in 3.01 seconds = 22.57 MB/sec

  • sudo hdparm -t --direct /dev/sdc

Timing O_DIRECT disk reads: 98 MB in 3.03 seconds = 32.35 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, 1.5689 s, 1.0 GB/s

Not exactly sure why. But my problem does not exist any more. Therefore closing this question.

Upvotes: 1

Related Questions