1

The Azure docs say:

It's a best practice to use one or more separate disks to store a virtual machine's data.

It's my understanding that using an attached disk is recommended (at least in part) to help increase performance since your applications won't share IOPS with the OS.

I'm not sure how I should be installing MySQL according to this. Is it recommending I put only the data on the attached disk, or the server and everything else that comes with the installation too?

2

I'm not sure how I should be installing MySQL according to this. Is it recommending I put only the data on the attached disk, or the server and everything else that comes with the installation too?

Your DB and OS should go on separate disks.

Just mount the attached disk, format it as desired, and then configure MySQL to use that location for its database files. If you already MySQL data, you can shut down the MySQL service, copy the data to the new location, re-configure MySQL reflect the new data storage location, and then start it back up.

2
  • Just to clarify my understanding, does this have an impact on the IOPS available to MySQL? – Kevin Nov 13 '15 at 21:52
  • Yes, due the fact that the DB does not have to compete for IO with your OS. Additionally (if Azure has this feature), you can specify faster storage for your DB if needed. The OS doesn't need fast storage. – EEAA Nov 13 '15 at 21:58
1

Several reasons not to use an Azure OS disk when storing database data (aside from dev/test purposes):

  • Using the OS disk for data will yield troubles due to the limited space (aside from competing with the OS itself). The OS disk vhd in Azure VM's are set to either 30GB or 127GB, depending on the image you're using. Even assuming 127GB, you'll likely have space issues with a production database. Attached disks are up to 1TB apiece, with up to 2 disks per VM core.
  • OS disk defaults to read/write cache, which is not what you'll typically use for a data disk (you'd likely choose read cache).
  • If you delete the VM, you'll lose your data. With attached disks, you can leave your data disks intact, for future use, even when deleting a VM.
  • You'll have much more flexibility performance-wise, with attached disks. A-, D-, and G-series VMs support 500 IOPS + 60MB/s per disk, backed by Azure Storage. DS- and GS-series VMs support Premium Storage disks, up to 5000 IOPS + 200MB/s per disk.
1
  • can this be used to swap file? wont i lose "data" when resizing the VM? whatever is on the swap file? is important? – Miguel May 19 '16 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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