腾讯云主机的 IO 惨不忍睹

2019-09-29 13:48:15 +08:00
 lihongjie0209

1U1G1M 的主机, 活动的时候购买的,随机 IO 不到 10M/s, 大家测试一下自己的服务器, 看看是不是活动主机的 IO 都是这么差。

测试流程

yum install sysbench
sysbench fileio --file-total-size=2G --file-num=100  --file-test-mode=rndrw prepare
sysbench fileio --file-total-size=2G --file-num=100  --file-test-mode=rndrw run
[root@VM_45_207_centos ~]# sysbench fileio --file-total-size=2G --file-num=100  --file-test-mode=rndrw run
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
    reads/s:                      137.04
    writes/s:                     91.33
    fsyncs/s:                     237.99

Throughput:
    read, MiB/s:                  2.14
    written, MiB/s:               1.43

General statistics:
    total time:                          10.0825s
    total number of events:              4603

Latency (ms):
         min:                                    0.00
         avg:                                    2.17
         max:                                   23.14
         95th percentile:                        5.67
         sum:                                 9988.99

Threads fairness:
    events (avg/stddev):           4603.0000/0.00
    execution time (avg/stddev):   9.9890/0.00

下面是我在本地机械硬盘上的虚拟机测试的测试结果, 虚拟机软件 VMware WorkStation

 ⚡ root@dev2  ~   master  sysbench fileio --file-test-mode=rndrw  run
sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
    reads/s:                      5081.59
    writes/s:                     3387.73
    fsyncs/s:                     10846.47

Throughput:
    read, MiB/s:                  79.40
    written, MiB/s:               52.93

General statistics:
    total time:                          10.0160s
    total number of events:              193399

Latency (ms):
         min:                                    0.00
         avg:                                    0.05
         max:                                    5.00
         95th percentile:                        0.16
         sum:                                 9856.46

Threads fairness:
    events (avg/stddev):           193399.0000/0.00
    execution time (avg/stddev):   9.8565/0.00

7428 次点击
所在节点    程序员
62 条回复
JimmyTinsley
2019-09-29 16:24:04 +08:00
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 1288.83
writes/s: 859.15
fsyncs/s: 2157.38

Throughput:
read, MiB/s: 20.13
written, MiB/s: 13.42

General statistics:
total time: 10.0059s
total number of events: 43006

Latency (ms):
min: 0.00
avg: 0.23
max: 14.06
95th percentile: 0.44
sum: 9956.45

Threads fairness:
events (avg/stddev): 43006.0000/0.00
execution time (avg/stddev): 9.9565/0.00


我是 vultr 的 1C1G, 不过似乎是 SSD, 跑分还行啊
lands
2019-09-29 18:11:32 +08:00
百度 2C2G
$ sysbench fileio --file-total-size=2G --file-num=100 --file-test-mode=rndrw run
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 946.48
writes/s: 630.99
fsyncs/s: 1582.06

Throughput:
read, MiB/s: 14.78
written, MiB/s: 9.86

General statistics:
total time: 10.0143s
total number of events: 31546

Latency (ms):
min: 0.00
avg: 0.32
max: 38.72
95th percentile: 0.99
sum: 9955.21

Threads fairness:
events (avg/stddev): 31546.0000/0.00
execution time (avg/stddev): 9.9552/0.00
Chingim
2019-09-29 18:25:40 +08:00
太惨了, 连 usb2.0 的速度都没有?
ilihai
2019-09-29 19:15:50 +08:00
用楼主的命令:

FATAL: Too large position discovered in request!

怎么破?
xiofee
2019-09-30 03:20:41 +08:00
两年前买的 1U2G1Mbps 腾讯云活动机器
-----------------------------
[root@VM_0_11_centos ~]# sysbench fileio --file-total-size=2G --file-num=100 --file-test-mode=rndrw run
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 268.22
writes/s: 178.88
fsyncs/s: 456.63

Throughput:
read, MiB/s: 4.19
written, MiB/s: 2.79

General statistics:
total time: 10.0717s
total number of events: 9004

Latency (ms):
min: 0.01
avg: 1.11
max: 17.60
95th percentile: 2.61
sum: 9964.08

Threads fairness:
events (avg/stddev): 9004.0000/0.00
execution time (avg/stddev): 9.9641/0.00
ryd994
2019-09-30 06:05:21 +08:00
因为你给的钱不够
云主机都是储存和计算节点分离,磁盘通过网络挂载。带宽够用,但是延迟问题无解。如果你对一致性没有太高要求的话可以加钱带本地 nvme 缓存,也就是所谓的 IO 优化实例。否则无解。
lihongjie0209
2019-09-30 08:51:15 +08:00
@ryd994 #46 IO 优化实例适不适合做数据库服务器, 如果不合适,有什么推荐的
ryd994
2019-09-30 09:29:08 +08:00
@lihongjie0209 带本地 write back 缓存的肯定可以,因为性能基本等于物理机
具体腾讯用的是什么我也不确定,你可以自己试试效果怎么样
afirefish
2019-09-30 09:30:00 +08:00
腾讯的:
Category Test Result
HDParm Disk Read 12.67 MB/s
HDParm Cached Disk Read 100.43 MB/s
DD Disk Write 40.8 MB/s
FIO 4k random read IOPS ( KB/s)
FIO 4k random write IOPS ( KB/s)
IOZone 4k read 5471 KB/s
IOZone 4k write 1561 KB/s
IOZone 4k random read 5860 KB/s
IOZone 4k random write 1582 KB/s
-----------------------------------------------------------------------
华为的:
Category Test Result
HDParm Disk Read 156.06 MB/s
HDParm Cached Disk Read 190.75 MB/s
DD Disk Write 164 MB/s
FIO 4k random read 5776 IOPS (23107 KB/s)
FIO 4k random write 7243 IOPS (28975 KB/s)
IOZone 4k read 12447 KB/s
IOZone 4k write 6167 KB/s
IOZone 4k random read 10055 KB/s
IOZone 4k random write 5075 KB/s
-----------------------------------------------------------------------

腾讯的 1H2G 的学生机,华为的是 200 一年的学生机。相比之下腾讯机器真的是惨不忍睹。
GoRoad
2019-09-30 10:12:17 +08:00
腾讯云的学生机

sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 273.34
writes/s: 182.26
fsyncs/s: 463.30

Throughput:
read, MiB/s: 4.27
written, MiB/s: 2.85

General statistics:
total time: 10.1213s
total number of events: 9222

Latency (ms):
min: 0.00
avg: 1.08
max: 29.76
95th percentile: 2.43
sum: 9980.24

Threads fairness:
events (avg/stddev): 9222.0000/0.00
execution time (avg/stddev): 9.9802/0.00
GoRoad
2019-09-30 10:17:36 +08:00
接上条 这是阿里云的学生机 差别有点大
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 556.84
writes/s: 371.23
fsyncs/s: 932.26

Throughput:
read, MiB/s: 8.70
written, MiB/s: 5.80

General statistics:
total time: 10.0187s
total number of events: 18542

Latency (ms):
min: 0.01
avg: 0.54
max: 72.08
95th percentile: 1.61
sum: 9981.45

Threads fairness:
events (avg/stddev): 18542.0000/0.00
execution time (avg/stddev): 9.9815/0.00
he583899772
2019-09-30 10:32:03 +08:00
昨天也买了,真的是差的不行,骗钱的
joejhy
2019-09-30 11:26:09 +08:00
IO 测试有很多种维度衡量,块大小 /队列深度 /并发等等都会影响测试结果。
而且不同测试的参数反应出来的结论是不一样的。

像楼主这种测试方式 ysbench fileio --file-total-size=2G --file-num=100 --file-test-mode=rndrw run,明显就是默认的小块+队列深度 1,吞吐带宽低是正常,这种参数反应出来的是 IO 延时;
如果想要测吞吐带宽,那就要大块 128K+队列深度 32 这种的来测吞吐。
lihongjie0209
2019-09-30 12:13:42 +08:00
@joejhy #53 这个只是一个比较宽泛的测试, 并不是想测试硬盘的某一个指标的具体性能。 我给出了在本地虚拟机的相同测试进行对比, 可以得出一个相对的测试结果。
azh7138m
2019-09-30 13:18:36 +08:00
@CallMeReznov 年付 12 刀的阿里云不是不能续费吗?
CFM880
2019-09-30 13:53:31 +08:00
阿里云的
```
root@iZj6ca349oujk89sabu89tZ:~# sysbench fileio --file-total-size=2G --file-num=100 --file-test-mode=rndrw run
sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 871.18
writes/s: 580.72
fsyncs/s: 1457.29

Throughput:
read, MiB/s: 13.61
written, MiB/s: 9.07

General statistics:
total time: 10.0166s
total number of events: 29046

Latency (ms):
min: 0.00
avg: 0.34
max: 85.67
95th percentile: 0.92
sum: 9957.00

Threads fairness:
events (avg/stddev): 29046.0000/0.00
execution time (avg/stddev): 9.9570/0.00

root@iZj6ca349oujk89sabu89tZ:~#
```
CallMeReznov
2019-09-30 14:00:43 +08:00
@azh7138m #55 后来一个一个月 30-40 包 1T 流量包的版本 没限速之前是 200M 带宽 现在应该是限速了,但是也比一般的强百倍.
EdwardLeeJan
2019-09-30 14:30:11 +08:00
我的也差得吓人,还好就挂个普通网站而已


sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 223.03
writes/s: 148.75
fsyncs/s: 377.84

Throughput:
read, MiB/s: 3.48
written, MiB/s: 2.32

General statistics:
total time: 10.0553s
total number of events: 7439

Latency (ms):
min: 0.00
avg: 1.34
max: 53.62
95th percentile: 3.36
sum: 9975.82

Threads fairness:
events (avg/stddev): 7439.0000/0.00
execution time (avg/stddev): 9.9758/0.00
mink
2019-09-30 15:28:47 +08:00
做的是真的差, 我就跑了一个 mysql 实例, 内存就满了 这还是 1G 的机器啊,500 的怎么活。
ragnaroks
2019-09-30 16:20:52 +08:00
[学生机]# sysbench fileio --file-total-size=1G --file-num=100 --file-test-mode=rndrw run
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 10.24MiB each
1024MiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 253.30
writes/s: 168.87
fsyncs/s: 423.05

Throughput:
read, MiB/s: 3.96
written, MiB/s: 2.63

General statistics:
total time: 10.1834s
total number of events: 8509

Latency (ms):
min: 0.00
avg: 1.17
max: 15.14
95th percentile: 3.55
sum: 9951.22

Threads fairness:
events (avg/stddev): 8509.0000/0.00
execution time (avg/stddev): 9.9512/0.00

---------------------------------------------------------------------------

[特价机]# sysbench fileio --file-total-size=2G --file-num=100 --file-test-mode=rndrw run
sysbench 1.0.17 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
100 files, 20.48MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 2071.55
writes/s: 1381.04
fsyncs/s: 3457.68

Throughput:
read, MiB/s: 32.36
written, MiB/s: 21.57

General statistics:
total time: 10.0193s
total number of events: 69151

Latency (ms):
min: 0.00
avg: 0.14
max: 30.04
95th percentile: 0.77
sum: 9948.41

Threads fairness:
events (avg/stddev): 69151.0000/0.00
execution time (avg/stddev): 9.9484/0.00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/605359

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX