101
shingoxray 2018-01-03 09:21:37 +08:00
楼上的搬瓦工咋这么快?我的小鸡才 48MB/s。
|
102
Hozzz 2018-01-03 09:50:20 +08:00
连 U 盘都不如,估计是被划到了共享存储并且里面有长时间高 I/O 用户_(:з」∠)_
|
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 |
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 |
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 |
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. |
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 慢一些吧。 |
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 有这个硬? |
109
tencentcloud 2018-01-03 11:31:52 +08:00
@sky77733,楼主您好,经与您电话沟通协商一致,您的问题已经解决了。后续您有问题可以通过拨打我们热线 4009100100 或者在官网提交工单咨询。再次感谢您的反馈与关注。
|
110
vjnjc 2018-01-03 12:33:28 +08:00
@asasas2114823 后来才发现我是本地盘,不是云盘。。。
|
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 美刀一年的搬瓦工.... |
112
jiabing520a 2018-01-03 19:33:13 +08:00
我也想说好低啊,这跟 USB2.0 的 U 盘有的一拼
|
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 |
114
sky77733 OP @tencentcloud 感谢所有朋友的回复,和热心测试的朋友。有很多的朋友给出了夸张的测试结果数据,那是你们没有加 oflag=dsync 这个参数,直接写内存当然快了 :D ,同时,很多朋友直接测试的是本地硬盘, 这个和网络云存储完全不一样(本地盘能不快吗? :D ),谢谢您们!
腾讯云的工程师也很努力和热心地还原问题场景,此问题已经得到解决,dd dsync 测试本身局限很多,太过关注也没有意义,让一个技术请教帖变成了水贴实在是抱歉,请大家不用再回复此帖,谢谢 |
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 ``` |
116
Apache553 2018-01-14 15:01:28 +08:00 via Android
我樹莓派的速度都是 16MB/s...
|