今天在单位做了一个关于SSD的基准测试.
环境
MySQL 5.6.14 全部使用默认参数(innodb_buffer_pool_size 128M)
机械硬盘一万五千转,Raid10
SSD硬盘,Raid10
测试一,sysbench 随机IO
测试使用100个文件,共80G空间.50并发线程.1000000 IO请求
命令如下
./sysbench --test=fileio --file-num=100 --file-total-size=80G prepare
./sysbench --test=fileio --file-num=100 --file-total-size=81900M --num-threads=50 --file-test-mode=rndrw --max-requests=1000000 run
测试结果如下
|
项目
|
机械硬盘
|
SSD
|
|
随机读写速率
|
38.266Mb/sec
|
319.42Mb/sec
|
8倍
|
请求响应速率
|
2449.05Requests/sec
|
20443.04 Requests/sec
|
8倍
|
总时长
|
408.9977s
|
49.1755s
|
8倍
|
最小处理时长
|
0.01ms
|
0.01ms
|
相同
|
平均处理时长
|
14.95ms
|
0.61ms
|
24倍
|
最大处理时长
|
7791.76ms
|
41.72ms
|
190倍
|
approx. 95 percentile
|
67.60ms
|
3.13ms
|
22倍
|
结论,SSD随机IO能力是机械硬盘的8倍左右.
原始数据
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 50
Extra file open flags: 0
100 files, 819Mb each
79.98Gb total file size
Block size 16Kb
Number of random requests for random IO: 1000000
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
Threads started!
Done.
Operations performed: 603177 Read, 402119 Write, 975874 Other = 1981170 Total
Read 9.2038Gb Written 6.1358Gb Total transferred 15.34Gb (319.42Mb/sec)
20443.04 Requests/sec executed
Test execution summary:
total time: 49.1755s
total number of events: 1005296
total time taken by event execution: 617.6757
per-request statistics:
min: 0.01ms
avg: 0.61ms
max: 41.72ms
approx. 95 percentile: 3.13ms
Threads fairness:
events (avg/stddev): 20105.9200/292.70
execution time (avg/stddev): 12.3535/0.19
测试二,sysbench 顺序IO
数据量同随机IO
命令如下
./sysbench --test=fileio --file-num=100 --file-total-size=81900M --num-threads=50 --file-test-mode=seqrd --max-requests=1000000 run
测试结果如下
|
项目
|
机械硬盘
|
SSD
|
|
顺序读写速率
|
565.04Mb/sec
|
1.5529Gb/sec
|
3倍
|
请求响应速率
|
36162.63 Requests/sec
|
101771.93 Requests/sec
|
3倍
|
总时长
|
144.9452s
|
51.5034s
|
3倍
|
最小处理时长
|
0.00ms
|
0.00ms
|
相同
|
平均处理时长
|
1.38ms
|
0.49ms
|
3倍
|
最大处理时长
|
268.11ms
|
34.13ms
|
8倍
|
approx. 95 percentile
|
5.45ms
|
0.97ms
|
6倍
|
结论,SSD的顺序IO是机械硬盘的3倍左右.
原始数据
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 50
Extra file open flags: 0
100 files, 819Mb each
79.98Gb total file size
Block size 16Kb
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential read test
Threads started!
Done.
Operations performed: 5241600 Read, 0 Write, 0 Other = 5241600 Total
Read 79.98Gb Written 0b Total transferred 79.98Gb (1.5529Gb/sec)
101771.93 Requests/sec executed
Test execution summary:
total time: 51.5034s
total number of events: 5241600
total time taken by event execution: 2565.6319
per-request statistics:
min: 0.00ms
avg: 0.49ms
max: 34.13ms
approx. 95 percentile: 0.97ms
Threads fairness:
events (avg/stddev): 104832.0000/606.26
execution time (avg/stddev): 51.3126/0.06
测试三,TPCC-MySQL
数据初始化,10个仓库
./tpcc_load 127.0.0.1 tpcc user password 10
测试,10个仓库,并发50,预热数据20s,测试300s
./tpcc_start -h 127.0.0.1 -u user -p password -d tpcc -w 10 -c 50 -r 20 -l 300 -f report -i 10 -t trx
分别将MySQL datadir设置在机械硬盘,SSD和tmpfs纯内存下.
|
机械硬盘
|
SSD
|
tmpfs内存
|
新订单数
|
32233
|
49575
|
67412
|
支付业务
|
32240
|
49590
|
67404
|
查询业务
|
3225
|
4962
|
6741
|
发货业务
|
3228
|
4964
|
6737
|
库存查询
|
3225
|
4962
|
6743
|
每分钟完成业务
|
6449.600 TpmC
|
9925.000 TpmC
|
13482.400 TpmC
|
结论,
在TPCC-MySQL的场景下,SSD是机械硬盘的1.5倍
而纯内存tmpfs是SSD的1.35倍,是机械硬盘的2倍
原始数据如下
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
option h with value '127.0.0.1'
option u with value 'user'
option p with value 'password'
option d with value 'tpcc'
option w with value '10'
option c with value '50'
option r with value '20'
option l with value '300'
option f with value 'report'
option i with value '10'
option t with value 'trx'
[server]: 127.0.0.1
[port]: 3306
[DBname]: tpcc
[user]: user
[pass]: password
[warehouse]: 10
[connection]: 50
[rampup]: 20 (sec.)
[measure]: 300 (sec.)
RAMP-UP TIME.(20 sec.)
MEASURING START.
10, 1819(0):4.355|4.809, 1807(0):0.892|2.730, 181(0):0.438|1.125, 183(0):5.179|5.824, 182(0):14.491|14.828
20, 1844(1):4.337|5.154, 1848(0):0.882|2.140, 185(0):0.402|0.725, 184(0):5.234|5.434, 185(0):14.109|14.217
30, 1847(1):4.383|5.660, 1853(0):0.875|1.217, 185(0):0.424|0.732, 186(0):4.998|6.178, 182(0):14.390|15.108
40, 1739(0):4.353|4.584, 1721(0):0.850|1.088, 173(0):0.396|0.530, 177(0):5.365|5.960, 177(0):14.911|15.827
50, 1782(0):4.402|4.633, 1801(0):0.887|2.226, 180(0):0.411|0.490, 177(0):5.176|5.694, 177(0):14.119|15.810
60, 1741(3):4.413|5.506, 1730(0):0.950|1.981, 173(0):0.395|0.431, 174(0):5.151|5.449, 173(0):13.900|14.614
70, 1750(4):4.449|5.412, 1764(0):0.889|1.569, 175(0):0.405|0.430, 174(0):5.271|5.562, 176(0):13.837|14.690
80, 1700(1):4.389|5.309, 1688(0):0.864|2.137, 170(0):0.410|0.647, 170(0):5.122|6.596, 170(0):14.040|14.109
90, 1689(0):4.357|4.983, 1692(0):0.946|2.815, 169(0):0.413|0.432, 168(0):5.419|5.504, 171(0):13.792|14.055
100, 1716(3):4.433|5.955, 1718(0):0.890|1.844, 172(0):0.417|0.503, 173(0):5.093|5.726, 168(0):13.639|13.853
110, 1651(2):4.416|6.877, 1644(0):0.887|1.386, 165(0):0.577|0.675, 163(0):5.261|5.701, 168(0):13.967|15.075
120, 1650(6):4.401|6.003, 1659(0):0.917|1.153, 165(0):0.434|0.461, 167(0):5.162|5.213, 165(0):14.373|14.791
130, 1656(3):4.427|5.764, 1647(0):0.856|2.563, 165(0):0.433|0.609, 167(0):5.220|5.304, 165(0):13.920|15.146
140, 1662(1):4.359|5.333, 1659(0):0.882|1.691, 166(0):0.434|0.501, 166(0):5.253|5.837, 165(0):13.947|15.235
150, 1576(1):4.414|5.030, 1586(0):0.895|1.188, 159(0):0.425|0.631, 158(0):5.037|6.337, 159(0):13.606|13.917
160, 1629(2):4.378|5.858, 1618(0):0.902|1.691, 161(0):0.418|0.479, 162(0):5.190|6.874, 159(0):13.820|14.432
170, 1590(3):4.411|6.490, 1592(0):0.900|1.483, 159(0):0.406|0.411, 157(0):5.094|6.817, 162(0):13.777|14.217
180, 1573(2):4.344|5.856, 1583(0):0.901|3.344, 159(0):0.463|0.485, 160(0):5.172|5.807, 159(0):13.859|14.419
190, 1619(0):4.360|4.827, 1616(0):0.891|1.535, 161(0):0.464|0.531, 161(0):5.306|6.945, 160(0):14.361|17.004
200, 1599(2):4.417|5.852, 1592(0):0.905|1.249, 160(0):0.429|0.488, 159(0):5.138|6.714, 160(0):14.032|14.398
210, 1602(2):4.384|5.139, 1606(0):0.872|1.196, 161(0):0.419|0.563, 160(0):5.123|6.889, 161(0):14.270|14.497
220, 1597(2):4.402|5.847, 1591(0):0.875|1.879, 159(0):0.413|0.445, 160(0):4.996|5.379, 160(0):13.982|14.334
230, 1565(0):4.384|4.956, 1558(0):0.875|1.370, 156(0):0.403|0.454, 157(0):5.072|5.923, 155(0):13.752|14.486
240, 1538(1):4.388|5.900, 1553(0):0.936|2.133, 154(0):0.424|0.467, 151(0):5.007|5.114, 157(0):14.311|14.534
250, 1565(2):4.394|5.045, 1558(0):0.871|1.697, 158(0):0.545|0.641, 161(0):5.123|5.246, 154(0):14.063|14.931
260, 1584(1):4.433|5.074, 1576(0):0.876|1.276, 157(0):0.408|0.581, 158(0):5.089|5.524, 159(0):14.521|15.735
270, 1600(1):4.440|5.423, 1596(0):0.939|1.614, 160(0):0.442|0.516, 158(0):5.270|5.662, 158(0):14.335|15.387
280, 1573(5):4.382|5.877, 1588(0):0.892|1.383, 157(0):0.432|2.675, 155(0):5.224|5.624, 157(0):13.744|13.944
290, 1582(1):4.403|5.662, 1592(0):0.867|1.194, 160(0):0.499|0.603, 161(0):5.129|5.397, 159(0):14.362|14.907
300, 1587(0):4.356|4.619, 1554(0):0.888|1.465, 157(0):0.440|0.540, 157(0):5.088|6.749, 159(0):14.042|14.419
STOPPING THREADS..................................................
[0] sc:49575 lt:50 rt:0 fl:0
[1] sc:49590 lt:0 rt:0 fl:0
[2] sc:4962 lt:0 rt:0 fl:0
[3] sc:4964 lt:0 rt:0 fl:0
[4] sc:4962 lt:0 rt:0 fl:0
in 300 sec.
[0] sc:49575 lt:50 rt:0 fl:0
[1] sc:49601 lt:0 rt:0 fl:0
[2] sc:4962 lt:0 rt:0 fl:0
[3] sc:4964 lt:0 rt:0 fl:0
[4] sc:4962 lt:0 rt:0 fl:0
(all must be [OK])
[transaction percentage]
Payment: 43.46% (>=43.0%) [OK]
Order-Status: 4.35% (>= 4.0%) [OK]
Delivery: 4.35% (>= 4.0%) [OK]
Stock-Level: 4.35% (>= 4.0%) [OK]
[response time (at least 90% passed)]
New-Order: 99.90% [OK]
Payment: 100.00% [OK]
Order-Status: 100.00% [OK]
Delivery: 100.00% [OK]
Stock-Level: 100.00% [OK]
9925.000 TpmC
原始数据均是SSD硬盘的测试结果.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29254281/viewspace-1482375/
,如需转载,请注明出处,否则将追究法律责任。