V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
sky77733
V2EX  ›  云计算

腾讯云的云硬盘用 DD 命令测试仅有 1.6MB/s 的速度,但腾讯云的工作人员坚称符合预期,由于我对 IO 这块不太熟悉,请大家帮忙看看,谢谢

  •  4
     
  •   sky77733 · 2018-01-02 13:50:24 +08:00 · 14363 次点击
    这是一个创建于 2306 天前的主题,其中的信息可能已经有所发展或是发生改变。
    腾讯云的云硬盘用 DD 命令测试仅有 1.6MB/s 的速度(测试命令 time dd bs=64k count=4k if=/dev/zero of=test ),但腾讯云的工作人员坚称符合预期(在国内友商相同 DD 命令测试均速在 20MB/S 的情况下,这速度真的是符合预期的吗?),多轮工单沟通下来,如果不是在其它的云服务商处也有服务器,我都差点被说服了,由于对系统 IO 这块不是很熟悉,请大家看看,他们所说的是否有理?谢谢

    以下是工单的沟通记录:

    沟通记录

    问题描述 2017-12-31 21:34:52
    系统盘所在的云硬盘 IO 极其低下(云硬盘的资源 ID:disk-lyez6hhm ),打开一个几 MB 的文档都要好几秒,请帮我看下,是否是此硬盘所在的仓库负载太高了?我另外一块作数据盘的云硬盘就还算比较正常。谢谢

    下面是硬盘的检测信息(多次检测都在 1.5MB/s 左右):
    root@VM-0-13-debian:~# time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 169.199 s, 1.6 MB/s

    real2m49.208s
    user0m0.008s
    sys0m0.520s




    10000340 : 2017-12-31 21:38:19
    此问题从今天中午到目前一直是这样,我之前以为是遇到了 IO 负载高峰,但经多次检测一直是这样,应该是云盘所在的节点有问题

    腾讯云工程师 : 2017-12-31 21:43:19
    您好,关于您反馈的问题正在为您核实,请您耐心等待。

    10000340 : 2017-12-31 21:51:38
    好的,目前云盘里还没有存放任何资料,如果需要迁移,无需考虑数据保存的问题,直接迁移即可,多谢!

    腾讯云工程师 : 2017-12-31 21:54:32
    您好,您那边方便提供下服务器登陆密码,我们进去测下吗?

    10000340 : 2017-12-31 22:01:36
    登录信息,谢谢

    root
    t*********

    腾讯云工程师 : 2017-12-31 22:02:30
    好的,收到,感谢您的配合。

    腾讯云工程师 : 2018-01-01 10:40:28
    您好,经核查您服务器磁盘性能是符合预期的,主要是 dd 命令是单线程的顺序写,块大小指定大小,IOPS 会到瓶颈,指定太大会导致 IOPS 上不去,建议使用 fio 命令可测试出磁盘极限性能,具体可以参考文档中测试方法:
    https://cloud.tencent.com/document/product/362/6741
    大图


    大图



    10000340 : 2018-01-01 13:09:07
    您好,
    这是我刚刚在本机系统盘上所做的测试:
    root@VM-0-13-debian:~# time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 159.261 s, 1.7 MB/s

    real 2m39.286s
    user 0m0.016s
    sys 0m0.508s

    这是在本机附加的数据盘(也是云盘,挂载在 www 目录上)上所作的测试:
    root@VM-0-13-debian:/www# time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 41.2061 s, 6.5 MB/s

    real 0m41.213s
    user 0m0.008s
    sys 0m0.384s

    同一台机器两个不同的云盘,测试结果差距如此大,这很明显是云盘所在的仓库有问题,如此之低的 IO 这怎么可能正常,而同样是云盘的 阿里云 和 京东云 就一直很正常,并且,刚刚我在 V2EX 论坛上咨询其他有你们云主机的人都说这完全不正常,如此之低的性能,如何来跑各类应用呢?我相信我将这对比结果发在你们论坛里也不可能有人敢说这是正常的。


    这是阿里云的云盘上同样命令的结果:

    # time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 10.135 s, 26.5 MB/s

    real 0m10.139s
    user 0m0.006s
    sys 0m0.322s

    这是京东云硬盘上同样命令的结果
    # time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 12.7922 s, 21.0 MB/s

    real 0m12.794s
    user 0m0.016s
    sys 0m0.468s





    腾讯云工程师 : 2018-01-01 13:51:27
    您好,dd 命令测试具有局限性,麻烦您使用 fio 命令测试一组数据这边对比进一步确认问题,或者授权这边登录您服务器安装 fio 命令进行测试,fio 使用可参考文档 1,各种块存储设备性能对比可参考文档 2
    https://cloud.tencent.com/document/product/362/6741
    https://cloud.tencent.com/document/product/362/2353

    大图



    温馨提示:若您在此单中有提供 SecretID/SecretKey 或账号密码等信息,请您在结单后尽快修改,以免造成不必要的损失。

    10000340 : 2018-01-01 14:01:39
    我明白你所说的 DD 命令的局限性,但问题是,同一台机器,同为云盘,同样执行 DD 命令为何两块硬盘的差距是如此之大?就算是有局限性,为何执行结果差距如此大?这只能说明一个问题,这块系统盘 IO 有问题,你刚刚的解释让我感觉像是我用皮尺量同一件衣服的袖子,发现结果是一只长一只短,你却认为我测量的工具有问题,让我换成你们认可的工具来量,这样有意义吗?

    10000340 : 2018-01-01 14:04:31
    本机系统云盘( 50GB):268435456 bytes (268 MB) copied, 159.261 s, 1.7 MB/s
    本机附加的数据云盘(40GB):268435456 bytes (268 MB) copied, 41.2061 s, 6.5 MB/s

    是否换一个工具这两个就一样了呢?谢谢



    腾讯云工程师 : 2018-01-01 14:55:27
    您好,云硬盘也是网络盘,系统盘和另外的数据盘不一定是在同一个宿主机上,所以性能可能会存在差异,您使用 dd 命令测试有两个弊端,因为是单线程,一个是块大小指定太小,IOPS 到达上限,块大小指定太大,IOPS 上不去,fio 可以开启多线程写入测试,可以测试出磁盘极限性能
    http://blog.yufeng.info/archives/2104

    10000340 : 2018-01-01 15:13:57
    您好,请看看您们论坛里管理人员对 同样的 DD 测试结果为 1.6MB 是怎么说的?

    http://bbs.qcloud.com/thread-44620-1-2.html

    如果您还非要坚持说 1.6MB/s 就是你们腾讯云的正常速度的话,那我只能说,您这样简单的回避问题会砸了腾讯云招牌的。

    祝您新年快乐



    10000340: 2018-01-01 15:16:16
    同样的 DD 命令,time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync,同样差不多的测试结果,但完全不同的处理。您这是代表您们腾讯云鄙视小客户么?

    腾讯云工程师 : 2018-01-01 17:15:07
    您好,抱歉让您久等了,目前还在核查您反馈的磁盘性能低问题,有结论给您工单回复,请关注工单回复,谢谢

    腾讯云工程师 : 2018-01-02 11:31:05
    您好,很抱歉让您久等了。这里和后端同事确认了下,目前在系统盘上使用 dd 命令测试的时候,获得的参数都是较低,但实际上并不会影响性能, 如下是我的测试结果:

    广州 s2 机型上系统盘云盘测试结果
    time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 173.576 s, 1.5 MB/s

    real2m53.599s
    user0m0.015s
    sys0m0.696s


    在香港云盘上测试结果:
    time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 172.495 s, 1.6 MB/s

    real2m52.523s
    user0m0.016s
    sys0m0.732s


    系统盘为本地盘的测试结果:
    time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 64.7305s, 4.1 MB/s

    real1m4.77s
    user0m0.007s
    sys0m0.405s

    从测试结果来看,云盘的速率都是差不多的,使用过程中性能都是符合预期的,如果您对磁盘性能要求较高,可以考虑使用本地盘作为系统盘。
    另外针对您工单里面反馈的论坛中的那个帖子,这边核实了下,当时对应用户反馈的磁盘是数据盘,并非系统盘。
    以上是给您的答复,如果您有疑问,可以继续回复,谢谢。

    10000340 : 2018-01-02 13:25:26
    抱歉,刚刚又去看了下所说的论坛中的那个帖子,该用户明明很明确的注明了有问题的盘是系统盘,怎么到了这儿就变成非系统盘了呢?下面是你们论坛原贴的内容:
    ------------------------------------
    pdm 发表于 2017-11-22 16:31
    你好!可以麻烦提供一下云硬盘的 ID 吗?我们来看下出了什么问题

    你好. 这是我的云盘信息:

    资源 ID disk-il523keb
    状态 已挂载
    地域 华东地区(上海) 可用区 上海一区
    磁盘类型 云硬盘
    磁盘属性 系统盘
    云硬盘容量 40G
    已挂载云主机 ins-r6qk0rsx
    点评


    pdm 楼主你好,根据我们后台查看,您的硬盘在双 11 高峰时刻被分配到了负载较高的仓库中,导致硬盘性能收到当时高峰影响,后续已经将其迁移到了负载正常的仓库里,不知道楼主是否方便再测试一下看看结果呢? 详情 回复 发表于 2017-11-24 20:26
    ----------------------------------

    ……。此处腾讯云的工程师尚未回复。
    第 1 条附言  ·  2018-01-02 14:48:34 +08:00
    腾讯云的最新回复:

    腾讯云工程师 : 2018-01-02 14:36:03
    您好,非常抱歉,这里是我看错了。帖子中的这个用户当时我们是为他的磁盘在后端做了迁移,目前您的磁盘和帖子中的用户一样是处于我们的万兆网络环境,并且是性能上没有帖子中用户的高负载问题。
    您可以看下我自己上面三台机器的测试结果,这里系统盘的测试结果是和您测试的差不多的,但是性能确实没有问题,上面的工单回复用也告知过您,我们是建议使用 fio 测试工具来进行压力测试的,其他几家云厂商也是推荐使用 fio 来测试的,您可以看下他们的说明。
    https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/benchmark_procedures.html
    https://help.aliyun.com/document_detail/25382.html?spm=5176.54360.880815.1.30a6077wlhHN5
    目前给您答复的就是您的磁盘性能确实没有问题,如果有问题的话,这边肯定是为您处理的,请您知悉。

    =====================
    感觉不想再撕了,他们坚决认为他们的这个 1.6MB/s 磁盘 IO 没有问题。并且也无视和友商的性能差距,只好是到期了就扔
    第 2 条附言  ·  2018-01-03 11:37:26 +08:00
    在提出这个疑问后, 工作人员多次电话沟通,现在问题基本解决, 就目前的情况来看,出现这样的情况,应该是云商各家采用的技术体系不一样,因为技术架构及指令的优先级问题导致 dd bs=64k count=4k if=/dev/zero of=test oflag=dsync 测试看起来慢,但实际应用上基本没有影响,正如上面有的朋友所说低配置的机器严格关注极限的 IO 操作意义不大,期间由于我对数据存储运维这块不熟悉,腾讯云专业的工程师打电话来详细给出了正确的测试方法,我也有点过份较真了。 我很作?哈哈
    同时也感谢其他所有回复,和热心测试的朋友。有很多的朋友给出了夸张的测试结果数据,那是你们没有加 oflag=dsync 这个参数,直接写内存当然快了 :D ,同时,很多朋友直接测试的是本地硬盘, 这个和网络云存储完全不一样(本地盘能不快吗? :D ),谢谢您们!
    1  2  
    shingoxray
        101
    shingoxray  
       2018-01-03 09:21:37 +08:00
    楼上的搬瓦工咋这么快?我的小鸡才 48MB/s。
    Hozzz
        102
    Hozzz  
       2018-01-03 09:50:20 +08:00
    连 U 盘都不如,估计是被划到了共享存储并且里面有长时间高 I/O 用户_(:з」∠)_
    kofj
        103
    kofj  
       2018-01-03 10:11:55 +08:00
    北京阿里
    root@bj-ali-1:~# time dd bs=64k count=4k if=/dev/zero of=test oflag=direct,nonblock
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB, 256 MiB) copied, 4.71763 s, 56.9 MB/s

    real 0m4.749s
    user 0m0.000s
    sys 0m0.156s

    北美 alpharacks
    root@na1:~# time dd bs=64k count=4k if=/dev/zero of=test oflag=direct,nonblock
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB, 256 MiB) copied, 0.780201 s, 344 MB/s

    real 0m0.838s
    user 0m0.000s
    sys 0m0.388s
    zpf124
        104
    zpf124  
       2018-01-03 10:18:26 +08:00
    确实好低啊.... 我玩梯子的小 vps 看起来也不算差...

    记录了 4096+0 的读入
    记录了 4096+0 的写出
    268435456 字节(268 MB)已复制,0.216422 秒,1.2 GB/秒

    real 0m0.250s
    user 0m0.002s
    sys 0m0.200s
    Quaintjade
        105
    Quaintjade  
       2018-01-03 10:24:58 +08:00
    好久没玩测速了。各位别秀内存速度啦,好歹加上正确参数。

    ===================================
    ### 阿里云国际版( 4.5 刀 /月)

    # dd bs=64k count=4k if=/dev/zero of=test conv=fdatasync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 2.54742 s, 105 MB/s

    # dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 9.19713 s, 29.2 MB/s

    ===================================
    ### GCE (最低配版约 5 刀 /月,目前在用免费额度)

    # dd bs=64k count=4k if=/dev/zero of=test conv=fdatasync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 7.17501 s, 37.4 MB/s

    # dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 8.55848 s, 31.4 MB/s

    ===================================
    ### Vultr ( 2.5 刀 /月)

    # dd bs=64k count=16k if=/dev/zero of=test conv=fdatasync
    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 2.97592 s, 361 MB/s

    # dd bs=64k count=8k if=/dev/zero of=test oflag=dsync
    8192+0 records in
    8192+0 records out
    536870912 bytes (537 MB) copied, 7.98753 s, 67.2 MB/s

    ===================================
    ### Ramnode ( 15 刀 /年)

    # dd bs=64k count=4k if=/dev/zero of=test conv=fdatasync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 4.64054 s, 57.8 MB/s

    # dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 4.16453 s, 64.5 MB/s

    ===================================
    ### 某不知名非云 VPS 1 ( 128.16 刀 /年)

    # dd bs=64k count=16k if=/dev/zero of=test conv=fdatasync
    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 3.28148 s, 327 MB/s

    # dd bs=64k count=8k if=/dev/zero of=test oflag=dsync
    8192+0 records in
    8192+0 records out
    536870912 bytes (537 MB) copied, 3.82915 s, 140 MB/s

    ===================================
    ### 某不知名非云 VPS 2 (约 4.08 刀 /月)

    # dd bs=64k count=4k if=/dev/zero of=test conv=fdatasync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 0.53575 s, 501 MB/s

    # dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 2.08743 s, 129 MB/s
    johnnydepp
        106
    johnnydepp  
       2018-01-03 10:42:41 +08:00
    纯转载:
    Ways in which you can invoke 'dd' to test the write speed:
    dd bs=1M count=256 if=/dev/zero of=test
    dd bs=1M count=256 if=/dev/zero of=test; sync
    dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync
    dd bs=1M count=256 if=/dev/zero of=test oflag=dsync
    What is the difference between those?
    dd bs=1M count=256 if=/dev/zero of=test
    The default behaviour of dd is to not “ sync ” (i.e. not ask the OS to completely write the data to disk before dd exiting). The above command will just commit your 128 MB of data into a RAM buffer (write cache) – this will be really fast and it will show you the hugely inflated benchmark result right away. However, the server in the background is still busy, continuing to write out data from the RAM cache to disk.
    dd bs=1M count=256 if=/dev/zero of=test; sync
    Absolutely identical to the previous case, as anyone who understands how *nix shell works should surely know that adding a ; sync does not affect the operation of previous command in any way, because it is executed independently, after the first command completes. So your (inflated) MB/sec value is already printed on screen while that sync is only preparing to be executed.
    dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync
    This tells dd to require a complete “ sync ” once, right before it exits. So it commits the whole 256 MB of data, then tells the operating system: “ OK, now ensure this is completely on disk ”, only then measures the total time it took to do all that and calculates the benchmark result.
    dd bs=1M count=256 if=/dev/zero of=test oflag=dsync
    Here dd will ask for completely synchronous output to disk, i.e. ensure that its write requests don ’ t even return until the submitted data is on disk. In the above example, this will mean sync'ing once per megabyte, or 256 times in total. It will be the slowest mode, as the write cache is basically unused at all in this case.
    johnnydepp
        107
    johnnydepp  
       2018-01-03 10:46:49 +08:00
    @johnnydepp
    继续转载:
    conv=fsync Synchronize output data and metadata just before finishing 意思也就是在 dd 命令结束前同步 data 和 metadata,那就是不是每一次写都同步一次咯,也就是如果我们在 dd 命令中写了 100 次,他可能是等到最后的时候才把他们同步到磁盘。而 oflag=dsync 是说 Use synchronized I/O for data. For the output file, this forces a physical write of output data on each write,注意这里边用词 a physical write of output data on each write,那就是他是每一次写都得等到这一次写写到了磁盘才进行下一个写,也就是如果我们使用 dd 写 100 次,他每次写都是写到磁盘后才进行下一次写的。所以这样当然要比 conv=fsync 慢一些吧。
    tammy
        108
    tammy  
       2018-01-03 11:05:52 +08:00
    root@sb2:~# time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 238.825 s, 1.1 MB/s

    real 3m58.859s
    user 0m0.022s
    sys 0m1.407s

    有这个硬?
    tencentcloud
        109
    tencentcloud  
       2018-01-03 11:31:52 +08:00
    @sky77733,楼主您好,经与您电话沟通协商一致,您的问题已经解决了。后续您有问题可以通过拨打我们热线 4009100100 或者在官网提交工单咨询。再次感谢您的反馈与关注。
    vjnjc
        110
    vjnjc  
       2018-01-03 12:33:28 +08:00
    @asasas2114823 后来才发现我是本地盘,不是云盘。。。
    sharmy
        111
    sharmy  
       2018-01-03 19:24:27 +08:00
    time dd bs=64k count=4k if=/dev/zero of=test
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 0.323653 s, 829 MB/s

    real 0m0.367s
    user 0m0.000s
    sys 0m0.192s

    9.9 美刀一年的搬瓦工....
    jiabing520a
        112
    jiabing520a  
       2018-01-03 19:33:13 +08:00
    我也想说好低啊,这跟 USB2.0 的 U 盘有的一拼
    liuygem
        113
    liuygem  
       2018-01-03 22:54:41 +08:00
    @imxieke 看来我买的是盗版的腾讯云香港 1

    [root@VM_0_11_centos ~]# time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB) copied, 153.795 s, 1.7 MB/s

    real 2m33.827s
    user 0m0.009s
    sys 0m0.639s
    sky77733
        114
    sky77733  
    OP
       2018-01-03 23:22:53 +08:00
    @tencentcloud 感谢所有朋友的回复,和热心测试的朋友。有很多的朋友给出了夸张的测试结果数据,那是你们没有加 oflag=dsync 这个参数,直接写内存当然快了 :D ,同时,很多朋友直接测试的是本地硬盘, 这个和网络云存储完全不一样(本地盘能不快吗? :D ),谢谢您们!
    腾讯云的工程师也很努力和热心地还原问题场景,此问题已经得到解决,dd dsync 测试本身局限很多,太过关注也没有意义,让一个技术请教帖变成了水贴实在是抱歉,请大家不用再回复此帖,谢谢
    warcraft1236
        115
    warcraft1236  
       2018-01-04 19:42:18 +08:00
    我用的某日本的 vps
    ```
    time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB, 256 MiB) copied, 3.28347 s, 81.8 MB/s

    real 0m3.326s
    user 0m0.000s
    sys 0m0.496s
    ```
    韩国腾讯云

    ```
    time dd bs=64k count=4k if=/dev/zero of=test oflag=dsync
    4096+0 records in
    4096+0 records out
    268435456 bytes (268 MB, 256 MiB) copied, 89.6295 s, 3.0 MB/s

    real 1m29.654s
    user 0m0.010s
    sys 0m0.451s
    ```
    Apache553
        116
    Apache553  
       2018-01-14 15:01:28 +08:00 via Android
    我樹莓派的速度都是 16MB/s...
    1  2  
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1471 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:36 · PVG 01:36 · LAX 10:36 · JFK 13:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.