在Azure文档中有一段关于如何让虚拟机的存储性能提高的介绍,基于此进行对比测试
To achieve scalability targets in Premium Storage, for all premium storage disks with cache set to ReadOnlyor None, you must disable "barriers" when you mount the file system. You don't need barriers in this scenario because the writes to premium storage disks are durable for these cache settings. When the write request successfully finishes, data has been written to the persistent store.
https://docs.microsoft.com/en-us/azure/storage/storage-premium-storage
机器:DS3 v2(4 cores, 14 GB memory),挂载了4个1023GB数据硬盘
使用mdadm为软RAID,使用sysbench(https://github.com/akopytov/sysbench)测试data stripping后的随机读写性能
1. 对比Host-Cache为Read-Only的情况下,fstab中是否禁用barrier的影响
启用barrier,单线程 | 启用barrier,64条线程 | 禁用barrier,单线程 | 禁用barrier,64条线程 | |
随机读 | 587.82 | 1637.72 | 743.77 | 9813.21 |
随机写 | 391.88 | 1090.99 | 495.85 | 6545.14 |
可以看出在read-only的host-cache下,禁用barrier,在多线程情况下,性能提升了6倍左右
2. 对比Read-Only Host Cache和Read/Write Host Cache
Read-Only Host Cache, 单线程 | Read-Only Host Cache,64条线程 | Read/Write Host Cache,单线程 | Read/Write Host Cache,64条线程 | |
随机读 | 587.82 | 1637.72 | 455.75 | 455.63 |
随机写 | 391.88 | 1090.99 | 303.83 | 303.75 |
相关资料:
https://www.azure.cn/documentation/articles/virtual-machines-linux-configure-raid
http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
新增
https://www.azure.cn/documentation/articles/virtual-machines-linux-optimization/
https://docs.microsoft.com/en-us/azure/storage/storage-premium-storage-performance
Enable ReadOnly Cache on premium storage disks with Read heavy operations to get higher Read IOPS.