Linux virtual machines on Azure use FIO test disks, and additional data disks to build raid to increase IOPS

Source: Internet
Author: User
Tags uuid

After a customer has established a virtual machine in Azure, there is usually a need for disk performance testing.

for Base Centos Linux on Azure The virtual machine environment performs a disk performance test.

in theAzureEstablished inLinuxafter a virtual machine, you can see two disksSDAand theSDB, whereSDAis the system disk,SDBas a temporary disk. The temporary disk is the local storage of the physical server where the virtual machine resides,Windows Azurewhen performing planned or unplanned maintenance, virtual opportunities are moved to other host servers, resulting in the loss of the contents of the temporary disk. In addition to the system disk and the temporary disk,Windows Azureusers are also allowed to mount data disks. ForLinuxvirtual machine, system disk only30Gspace, it is necessary to mount the data disk to store the application data in the actual application scenario. In Azure Linuxin a virtual machine, forA7type of virtual machine allows up to mount -data disks, providing16TBstorage space and these disks are supported byRaidmechanism to get a better read/write performance.

1. Install the disk test tool

Fio is a common disk IOPS test Tools. First install the Fioin Centos:

Yum Install gcc Libaio-devel–y

Download Fio and install:

Wgethttp://brick.kernel.dk/snaps/fio-2.1.6.1.tar.gz

TAR-ZXVF fio-2.1.6.1.tar.gz

CD fio-2.1.6.1

make&& make Install

2. View Current disk information

Fdisk-l

You can see the current system disk and the temporary disk

3. Attachment Data Disk

in the Windows Azure the management Portal , add a data disk to the test virtual machine.

Enter the disk size and view the disk information after the attach succeeds:

Sudo grep scsi/var/log/messages

To perform a partition operation on a new disk:

sudo fdisk/dev/sdc

After partitioning is complete, create the file system:

sudo mkfs-t EXT4/DEV/SDC1

To create a mount point

sudo mkdir/datadrive


sudo mount/dev/sdc1/datadrive

Auto mount for next reboot, need to be modified /etc/fstab file

Execution sudo-i Blkio gets the new disk's UUID , and add to Fstab file

' Uuid=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e/datadrive ext4 defaults 1 2 '

4. perform the test

Perform a random write test on the system disk

Fio-filename=/dev/sda1-direct=1-iodepth1-thread-rw=randwrite-ioengine=psync-bs=16k-size=20g-numjobs=30-runtime =1000-group_reporting-name=test

of the test results ioPS to be 478, with the Windows Azure per disk 500IOPS more consistent.

Next, random and random read and write tests are performed:

Random Read test

Fio-filename=/dev/sda1-direct=1-iodepth1-thread-rw=randread-ioengine=psync-bs=16k-size=2g-numjobs=10-runtime= 1000-group_reporting-name=test

Random Read and write test

fio-filename=/dev/sda1-direct=1-iodepth1-thread-rw=randrw-rwmixread=70-ioengine=psync-bs=16k-size=20g-numjobs= 30-runtime=100-group_reporting-name=test1

use the above method to the data disk /DEV/SDC1 to test.

Parameter description:

FILENAME=/DEV/SDB1 test file name, usually select the disk to be tested Data directory.

direct=1 the test process bypasses the machine's own Buffer . Make the test results more realistic.

Rw=randwrite test the random write I/O

RW=RANDRW test random Write and read I/O

bs=16k One-time io The block file size is 16k

bsrange=512-2048 ditto, size range of the data block

size=5g The test file size for this time is 5g , with each 4k of the io to test.

numjobs=30 this time the test thread is .

runtime=1000 test Time is + seconds, if not written, will always 5g File Points 4k each time you finish writing.

Ioengine=psyncio engine Use Pync Way

rwmixwrite=30 in mixed read and write mode, the write-up takes 30%

group_reporting For information about displaying the results, summarize each process.

In addition

lockmem=1g Use only 1g memory for testing.

zero_buffers with 0 Initializing the system Buffer .

nrfiles=8 number of files generated per process

Deployment RAID the idea of special in the Windows Azure created on the Linux VMs , in VMS on Deployment MySQL and the ability to get higher performance disk reads / Write access, better data security, support for more concurrent access is better


for Azure on the Linux virtual machines, you can use the following steps to create RAID :

1. attach multiple data disks to a virtual machine.

The number of data disks that can be attached to different sizes of virtual machines is not the same: 8 of Nuclear XL and the A7 you can add up to - Block 1T data disks, that is, each virtual machine can provide a maximum of 16TB .

This work can be done in Azure Management Portal (Management Portal) come on, you can do it. PowerShell scripts, etc. to add.

It is important to note that for data disks, the host cache default preference is " No " , so that the application of the database, it is more advantageous to ensure that the data is not lost.

2. in a Linux virtual machine, using root privileges, perform the following create RAID, File system and Disk installation commands:

Mdadm--create/dev/md0--level=0--RAID-DEVICES=4/DEV/SDC/DEV/SDD/DEV/SDE/DEV/SDF

Mkfs.ext3/dev/md0

Mount/dev/md0/raid0

For example, using 4 block data disks, deploying RAID-0 .

of different RAID level, which satisfies the user's ability to read on disk / write performance, data validation and other requirements.


Linux virtual machines on Azure use FIO test disks, and additional data disks to build raid to increase IOPS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.