Azure 虚拟机规模集上的磁盘速度比宣传的要慢

Azure 虚拟机规模集上的磁盘速度比宣传的要慢

我有一个包含 5 个节点的 Azure Service Fabric 集群,由 Azure 虚拟机规模集托管。实例的大小为 Standard_D2ds_v4,标称磁盘速度最高为 3200 IOPS。VMSS 上有一个“Premium SSD LRS”数据磁盘,大小为 50 GB / 240 Max IOPS / 50 MBps 吞吐量。

由于我需要此磁盘用于 EventStoreDB 数据库,我猜 240 IOPS 对于生产来说太慢了。因此我尝试了另一个 257 GB 大小的“Premium SSD LRS”数据磁盘,它应该可以达到 2300 Max IOPS / 150 MBps 吞吐量。仍然很慢,尤其是对于 SSD 来说,但至少比第一个磁盘要好。

指定高级 SSD 数据盘速度

在我开始将数据库迁移到新磁盘之前,我想确定一下,并测量了速度,结果发现新磁盘和第一个磁盘一样慢。

我用的是DISKSPD 工具记录在微软文档进行测量。我得到了以下结果:

PS C:\Users\<user>\Downloads\DiskSpd\amd64> .\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh testfile.dat

Command Line: C:\Users\<user>\Downloads\DiskSpd\amd64\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh testfile.dat

Input parameters:

        timespan:   1
        -------------
        duration: 30s
        warm up time: 30s
        cool down time: 0s
        random seed: 0
        thread pool with 4 threads
        number of outstanding I/O operations per thread: 0
        path: 'testfile.dat'
                think time: 0ms
                burst size: 0
                software cache disabled
                hardware write cache disabled, writethrough on
                performing mix test (read/write ratio: 50/50)
                block size: 8KiB
                using random I/O (alignment: 8KiB)
                number of outstanding I/O operations per thread: 128
                IO priority: normal

System information:

        computer name: prod000000
        start time: 2022/06/20 08:03:39 UTC

Results for timespan 1:
*******************************************************************************

actual test time:       30.00s
thread count:           4
proc count:             2

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|   5.68%|   2.34%|    3.33%|  94.32%
   1|   4.17%|   3.23%|    0.94%|  95.83%
-------------------------------------------
avg.|   4.92%|   2.79%|    2.14%|  95.08%

Total IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |        46063616 |         5623 |       1.46 |     187.41 | testfile.dat (10GiB)
     1 |        45998080 |         5615 |       1.46 |     187.14 | testfile.dat (10GiB)
     2 |        46170112 |         5636 |       1.47 |     187.84 | testfile.dat (10GiB)
     3 |        46120960 |         5630 |       1.47 |     187.64 | testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         184352768 |        22504 |       5.86 |     750.03

Read IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |        23109632 |         2821 |       0.73 |      94.02 | testfile.dat (10GiB)
     1 |        22732800 |         2775 |       0.72 |      92.49 | testfile.dat (10GiB)
     2 |        22986752 |         2806 |       0.73 |      93.52 | testfile.dat (10GiB)
     3 |        23117824 |         2822 |       0.73 |      94.05 | testfile.dat (10GiB)
------------------------------------------------------------------------------
total:          91947008 |        11224 |       2.92 |     374.08

Write IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |        22953984 |         2802 |       0.73 |      93.39 | testfile.dat (10GiB)
     1 |        23265280 |         2840 |       0.74 |      94.65 | testfile.dat (10GiB)
     2 |        23183360 |         2830 |       0.74 |      94.32 | testfile.dat (10GiB)
     3 |        23003136 |         2808 |       0.73 |      93.59 | testfile.dat (10GiB)
------------------------------------------------------------------------------
total:          92405760 |        11280 |       2.94 |     375.95
PS C:\Users\<user>\Downloads\DiskSpd\amd64> .\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh D:\testfile.da
t

Command Line: C:\Users\<user>\Downloads\DiskSpd\amd64\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh D:\testfile.dat

Input parameters:

        timespan:   1
        -------------
        duration: 30s
        warm up time: 30s
        cool down time: 0s
        random seed: 0
        thread pool with 4 threads
        number of outstanding I/O operations per thread: 0
        path: 'D:\testfile.dat'
                think time: 0ms
                burst size: 0
                software cache disabled
                hardware write cache disabled, writethrough on
                performing mix test (read/write ratio: 50/50)
                block size: 8KiB
                using random I/O (alignment: 8KiB)
                number of outstanding I/O operations per thread: 128
                IO priority: normal

System information:

        computer name: prod000000
        start time: 2022/06/20 08:07:46 UTC

Results for timespan 1:
*******************************************************************************

actual test time:       30.01s
thread count:           4
proc count:             2

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|  12.39%|   2.19%|   10.20%|  87.61%
   1|  12.18%|   5.10%|    7.08%|  87.82%
-------------------------------------------
avg.|  12.29%|   3.64%|    8.64%|  87.71%

Total IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       629145600 |        76800 |      19.99 |    2558.97 | D:\testfile.dat (10GiB)
     1 |      1155129344 |       141007 |      36.71 |    4698.34 | D:\testfile.dat (10GiB)
     2 |       634142720 |        77410 |      20.15 |    2579.29 | D:\testfile.dat (10GiB)
     3 |      1145102336 |       139783 |      36.39 |    4657.56 | D:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:        3563520000 |       435000 |     113.24 |   14494.16

Read IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       315432960 |        38505 |      10.02 |    1282.98 | D:\testfile.dat (10GiB)
     1 |       579280896 |        70713 |      18.41 |    2356.15 | D:\testfile.dat (10GiB)
     2 |       317087744 |        38707 |      10.08 |    1289.71 | D:\testfile.dat (10GiB)
     3 |       574537728 |        70134 |      18.26 |    2336.86 | D:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:        1786339328 |       218059 |      56.76 |    7265.71

Write IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       313712640 |        38295 |       9.97 |    1275.99 | D:\testfile.dat (10GiB)
     1 |       575848448 |        70294 |      18.30 |    2342.19 | D:\testfile.dat (10GiB)
     2 |       317054976 |        38703 |      10.07 |    1289.58 | D:\testfile.dat (10GiB)
     3 |       570564608 |        69649 |      18.13 |    2320.70 | D:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:        1777180672 |       216941 |      56.47 |    7228.45
PS C:\Users\<user>\Downloads\DiskSpd\amd64> .\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh S:\testfile.da
t

Command Line: C:\Users\<user>\Downloads\DiskSpd\amd64\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh S:\testfile.dat

Input parameters:

        timespan:   1
        -------------
        duration: 30s
        warm up time: 30s
        cool down time: 0s
        random seed: 0
        thread pool with 4 threads
        number of outstanding I/O operations per thread: 0
        path: 'S:\testfile.dat'
                think time: 0ms
                burst size: 0
                software cache disabled
                hardware write cache disabled, writethrough on
                performing mix test (read/write ratio: 50/50)
                block size: 8KiB
                using random I/O (alignment: 8KiB)
                number of outstanding I/O operations per thread: 128
                IO priority: normal

System information:

        computer name: prod000000
        start time: 2022/06/20 08:11:46 UTC

Results for timespan 1:
*******************************************************************************

actual test time:       30.00s
thread count:           4
proc count:             2

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|   9.48%|   1.30%|    8.18%|  90.52%
   1|   7.14%|   4.64%|    2.50%|  92.86%
-------------------------------------------
avg.|   8.31%|   2.97%|    5.34%|  91.69%

Total IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       215162880 |        26265 |       6.84 |     875.46 | S:\testfile.dat (10GiB)
     1 |       214958080 |        26240 |       6.83 |     874.63 | S:\testfile.dat (10GiB)
     2 |       215547904 |        26312 |       6.85 |     877.03 | S:\testfile.dat (10GiB)
     3 |       214466560 |        26180 |       6.82 |     872.63 | S:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         860135424 |       104997 |      27.34 |    3499.75

Read IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       107978752 |        13181 |       3.43 |     439.35 | S:\testfile.dat (10GiB)
     1 |       107872256 |        13168 |       3.43 |     438.91 | S:\testfile.dat (10GiB)
     2 |       107470848 |        13119 |       3.42 |     437.28 | S:\testfile.dat (10GiB)
     3 |       107282432 |        13096 |       3.41 |     436.51 | S:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         430604288 |        52564 |      13.69 |    1752.06

Write IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       107184128 |        13084 |       3.41 |     436.11 | S:\testfile.dat (10GiB)
     1 |       107085824 |        13072 |       3.40 |     435.71 | S:\testfile.dat (10GiB)
     2 |       108077056 |        13193 |       3.44 |     439.75 | S:\testfile.dat (10GiB)
     3 |       107184128 |        13084 |       3.41 |     436.11 | S:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         429531136 |        52433 |      13.65 |    1747.69
PS C:\Users\<user>\Downloads\DiskSpd\amd64> .\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh T:\testfile.da
t

Command Line: C:\Users\<user>\Downloads\DiskSpd\amd64\diskspd.exe -c10G -w50 -b8K -F4 -r -o128 -W30 -d30 -Sh T:\testfile.dat

Input parameters:

        timespan:   1
        -------------
        duration: 30s
        warm up time: 30s
        cool down time: 0s
        random seed: 0
        thread pool with 4 threads
        number of outstanding I/O operations per thread: 0
        path: 'T:\testfile.dat'
                think time: 0ms
                burst size: 0
                software cache disabled
                hardware write cache disabled, writethrough on
                performing mix test (read/write ratio: 50/50)
                block size: 8KiB
                using random I/O (alignment: 8KiB)
                number of outstanding I/O operations per thread: 128
                IO priority: normal

System information:

        computer name: prod000000
        start time: 2022/06/20 08:13:01 UTC

Results for timespan 1:
*******************************************************************************

actual test time:       30.00s
thread count:           4
proc count:             2

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|   9.17%|   1.51%|    7.66%|  90.83%
   1|   3.39%|   1.93%|    1.46%|  96.61%
-------------------------------------------
avg.|   6.28%|   1.72%|    4.56%|  93.72%

Total IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       214761472 |        26216 |       6.83 |     873.79 | T:\testfile.dat (10GiB)
     1 |       215842816 |        26348 |       6.86 |     878.18 | T:\testfile.dat (10GiB)
     2 |       214679552 |        26206 |       6.82 |     873.45 | T:\testfile.dat (10GiB)
     3 |       215810048 |        26344 |       6.86 |     878.05 | T:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         861093888 |       105114 |      27.37 |    3503.47

Read IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       107831296 |        13163 |       3.43 |     438.73 | T:\testfile.dat (10GiB)
     1 |       108183552 |        13206 |       3.44 |     440.16 | T:\testfile.dat (10GiB)
     2 |       106881024 |        13047 |       3.40 |     434.86 | T:\testfile.dat (10GiB)
     3 |       108150784 |        13202 |       3.44 |     440.03 | T:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         431046656 |        52618 |      13.70 |    1753.77

Write IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |       106930176 |        13053 |       3.40 |     435.06 | T:\testfile.dat (10GiB)
     1 |       107659264 |        13142 |       3.42 |     438.03 | T:\testfile.dat (10GiB)
     2 |       107798528 |        13159 |       3.43 |     438.59 | T:\testfile.dat (10GiB)
     3 |       107659264 |        13142 |       3.42 |     438.03 | T:\testfile.dat (10GiB)
------------------------------------------------------------------------------
total:         430047232 |        52496 |      13.67 |    1749.70

我对所有磁盘进行了测试以进行比较:

  • C:\-> 操作系统磁盘
  • D:\ -> 临时磁盘(不可用于数据库,因为在某些维护工作期间数据可能会丢失)
  • S:\ -> 50 GB 数据盘
  • S:\ -> 257 GB 数据盘

如您所见,我只实现了指定速度的一小部分 IOPS 和吞吐量,并且两个数据盘的速度一样慢。我配置错了吗?

编辑: 看起来 IOPS 还行。我假设读写是接连发生的,因此 IOPS 为 1750。总测量值为 3500 IOPS,甚至高于标称的最大值 2800。编辑2:3500 IOPS 可能与托管高级 SSD 的爆发

但是,吞吐量看起来不太好,27.3 MBps 肯定低于标称的 50 MBps 和 150 MBps。编辑2:通过突发我应该可以达到 170 MBps,而不是 150 MBps。

为什么这两个驱动器的速度一样快的问题仍然存在。

答案1

Microsoft 支持指出吞吐量低的原因是测试的块大小太小。我用更大的块大小验证了这一点,并得到了承诺的数字。

小盘和大盘速度相同,是因为两者的信用突发速度相同,信用消耗后,速度会降低到单个较低速度。

相关内容