Currently Azure offers two types of storage for virtual machines, one is standard storage, HDD-based, and one is high-performance storage premium Storage ( PS, hereinafter abbreviated), SSD-based. Provide good support for high performance, low latency, I/O intensive applications such as database MySQL, MONGODB,SAP, etc.
This article focuses on best practices for building database servers using premium storage on CentOS, including how to build a 50,000 level IOPS server by using soft RAID when your application needs exceed the single-disk IOPS limit.
Currently premium storage is only available for DS/GS/FS series machines as data disks, depending on the size of the virtual machine, you can mount up to 32T of premium storage for up to 64000 IOPS (limited by your virtual machine size and disk bandwidth) for each virtual machine.
It is important to understand that disk performance depends on three features: disk type, disk size, and virtual machine size. Premium disks have higher I/O limits than standard disks, and I/O limits increase with the size of the disk, and larger virtual machines have higher bandwidth limitations compared to smaller virtual machines. When using premium disks, make sure that the virtual machine is large enough to handle the total disk bandwidth.
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094219374-477858781. PNG "style=" border:0px; "/>
Precautions
In this article, for example CentOS 6.7, using DS14 as a test virtual machine to use premium storage on CentOS as a database server, there are several items to note:
1. If you want to get the best performance and stability, you must manually install the LIS 4.1 or more drivers on CentOS 6/7 as follows:
https://www.microsoft.com/en-us/download/details.aspx?id=51612
The instructions for LIS are as follows: https://www.azure.cn/documentation/articles/storage-premium-storage/
To facilitate the download, I have put the latest LIS4.1 package in the BLOB storage, Linux direct wget can be downloaded:
https://www.azure.cn/documentation/articles/storage-premium-storage/
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094220389-1085357049. PNG "style=" border:0px; "/>
#安装之前首先保证你的系统最新
$ sudo yum update
Please note: The installation of LIS requires that your kernel is the latest version, so after the update, please restart the machine to ensure that the latest Linux kernel is loaded, or the subsequent installation will be error.
#解压缩并安装LIS4
$ TAR-XZVF lis-rpms-4.1.2-2.tar.gz
$ sudo./inshall.sh
There may be some warnings that can be ignored, and the machine needs to be restarted after the installation is complete for the new driver to take effect.
[Email protected] lisiso]$ rpm-aq|grep microsoft
Kmod-microsoft-hyper-v-4.1.2.2-20161013.x86_64
Microsoft-hyper-v-debuginfo-4.1.2.2-20161013.x86_64
Microsoft-hyper-v-4.1.2.2-20161013.x86_64
2. Use cache settings for premium storage:
For premium premium disk cache settings, you need the right settings for the best performance based on the actual situation of your app:
set to None: If your app is basically writing, or more than 80% of the write operation, the cache is set to none.
set to read-only: This option is the default option for premium storage and is the most common option, which is recommended if your app operation is read-write or read-only.
set to read and write: If your program can handle cached data and can write cached data to a persistent disk when needed, there is a high demand for the application and there may be data loss due to improper handling.
For example, for SQL Server, you can:
For MySQL database, it is similar, you can set the bin log file as a directory, and the data file is also set as a separate directory, the use of caching for the best performance.
3. For CentOS 6/7 users, if you use the cache policy is "none" or "Read Only", you must mount the disk when the barrier set to 0, the practice is generally set in the Fstab file, see the following example.
4. When setting the Fstab automatic loading, be sure to use the UUID, or in some cases unpredictable problems, in addition, when setting up Fstab, in order to avoid in some cases the disk load failure and the system does not boot (such as the most common UUID write error, Configuration errors, etc.) it is best to add nobootwait (Ubuntu) or Nofail (CentOS) parameters, as shown in the following example.
Single P30 disk performance test
Create a DS series of virtual machines, if you need a higher level of processing performance of virtual machines, you can create a DS V2 series of virtual machines, the V2 series of virtual machine processing power than the DS series of about 35%, this example creates a DS14 series of virtual machines:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094221249-2055615617. PNG "style=" border:0px; "/>
To mount a single 1024-size P30 SSD disk to a virtual machine, we perform a single-disk performance test:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094221983-1294171033. PNG "style=" border:0px; "/>
To view the added disk, which is currently a bare device, you need to partition and add:
$ ls-l/dev/sd*
$ sudo fdisk/dev/sdc
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094222905-1135990669. PNG "style=" border:0px; "/>
Enter N to create a new partition, p select primary,partition Number select 1, the other option defaults.
then enter T, select Partition to 1, modify hex code to FD, this type represents Linux raid auto:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094223624-2090945319. PNG "style=" border:0px; "/>
Repeat the above steps until the newly added 4 disk partitions are complete:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094224452-617086576. PNG "style=" border:0px; "/>
4. We'll use SDC to do a single-disk test, format the device, create the directory, mount the partition to the test directory:
$ sudo mkfs-t ext4/dev/sdc1
$ sudo mkdir/data
$ sudo mount/dev/sdc1/data
5. We use the standard Linux Disk Test tool FIO to test the performance of the disk, first we install the FIO software, using Epel repo to do the installation:
$ sudo yum install Epel-release
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094225420-197475034. PNG "style=" border:0px; "/>
$ sudo yum install Fio
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201611/845013-20161109094226014-1974000742. PNG "style=" border:0px; "/>
Build high-performance Linux servers with Azure Premium storage (1)