PCIe固态存储和HDD常见的硬盘性能对比测试
2周测试后,导致以下结果
MySQL-OLTP测试结果:(50表。每个表1000广域网数据,1000个线程)
TPS:MySQL在PCIe固态存储上执行是在HDD上执行的5.63倍
writes:MySQL在PCIe固态存储上执行是在HDD上执行的5.58倍
reads:MySQL在PCIe固态存储上执行是在HDD上执行的5.55倍
Response_time:MySQL在PCIe固态存储上执行比在HDD上执行响应时间快44.45倍
Errors:MySQL在PCIe固态存储上执行是在HDD上执行错误率低83.5倍
随机IO測试结论:
PCIe固态存储随机读写IO处理能力是HDD随机读写IO处理能力的20倍
下面是具体測试过程
准备工作
操作系统:CentOS6.4 64位
D B:MySQL5.6.22 64位
硬 盘:PCIe(Shannon Direct-IO 1.6TB)、HDD
測试工具:sysbench0.5
监控工具:zabix
一、安装sysbench 0.5
同一时候0.5相比0.4须要消耗很多其它的cpu资源。
下载sysbench源代码包
原来官网 http://sysbench.sourceforge.net 已停用。眼下sysbench代码托管在launchpad上https://launchpad.net/sysbench
更新和安装依赖包
yum -y install gcc
yum -y install libtool
安装bzrclient
yum -y install bzr
在线获取0.5的版本号,#下载到当前文件夹,文件名称为: sysbench_0.5
bzr branch lp:sysbench
cd sysbench_0.5/
执行命令:./autogen.sh,对环境进行清理
./autogen.sh
./configure --with-mysql-includes=/usr/local/mysqla/include/ --with-mysql-libs=/usr/local/mysqla/lib/
# with-mysql-includes 指定MySQL安装文件夹
# with-mysql-libs 指定MySQL lib所在文件夹
make && make install
假设遇到下面错误
../libtool: line 841: X--tag=CC: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 2234: X-g: command not found
../libtool: line 2234: X-O2: command not found
../libtool: line 1954: X-L/usr/local/mysqla/lib/: No such file or directory
../libtool: line 2403: Xsysbench: command not found
../libtool: line 2408: X: command not found
../libtool: line 2415: Xsysbench: command not found
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found
../libtool: line 2632: X-L/home/sysopt/src/sysbench-0.4.12/sysbench: No such file or directory
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found
../libtool: line 2632: X-L/home/sysopt/src/sysbench-0.4.12/sysbench: No such file or directory
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found
可能原因:
1、没装依赖包libtool
2、安装的版本号不正确(libtool版本号过旧)
3、其他原因
解决方法:
1、安装依赖包libtool
2、libtoo更新到新版本号
3、用autoreconf取代autogen.sh,方法例如以下:
autoreconf -i
configure
make
make install
成功安装后可通过help命令查看sysbench帮助
[root@localhost src]# sysbench --help
Missing required command argument.
Usage:
sysbench [general-options]... --test=<test-name> [test-options]... command General options:
--num-threads=N number of threads to use [1]#使用线程数量
--max-requests=N limit for total number of requests [10000]#请求数,默觉得10000
--max-time=N limit for total execution time in seconds [0]#执行时间。默觉得0表示表示不限制
--forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
--thread-stack-size=SIZE size of stack per thread [64K]
--tx-rate=N target transaction rate (tps) [0]
--report-interval=N periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]#0.5的新增參数(默认值0,表示禁用该功能)在指定的时间间隔报告測试信息,<span style="font-size:12px;">不用等到执行结束时再得到反馈</span>
--report-checkpoints=[LIST,...]dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
--test=STRING test to run
--debug=[on|off] print more debugging info [off]
--validate=[on|off] perform validation checks where possible [off]
--help=[on|off] print help and exit
--version=[on|off] print version and exit [off]
--rand-init=[on|off] initialize random number generator [off]#初始化时生成随机的数据。默认关闭
--rand-type=STRING random numbers distribution {uniform,gaussian,special,pareto} [special]
--rand-spec-iter=N number of iterations used for numbers generation [12]
--rand-spec-pct=N percentage of values to be treated as 'special' (for special distribution) [1]
--rand-spec-res=N percentage of 'special' values to use (for special distribution) [75]
--rand-seed=N seed for random number generator, ignored when 0 [0]
--rand-pareto-h=N parameter h for pareto distibution [0.2] Log options:
--verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3] --percentile=N percentile rank of query response times to count [95] Compiled-in tests:測试项目
fileio - File I/O test #磁盘IO測试
cpu - CPU performance test #CPU运算性能
memory - Memory functions speed test #内存分配及传输速度
threads - Threads subsystem performance test #POSIX线程性能
mutex - Mutex performance test #相互排斥性能測试 Commands: prepare run cleanup help version See 'sysbench --test=<name> help' for a list of options for each test.
二、測试
1.MySQL-OLTP測试
数据准备
[root@localhost sysbench_0.5]# sysbench --mysql-db=sbtest --num-threads=24 --mysql-engine-trx=yes --mysql-table-engine=innodb --rand-type=special --mysql-host=localhost --mysql-port=3307 --mysql-user=root --mysql-password= --mysql-socket=/data1/lib/mysql/mysql.sock
--test=sysbench/tests/db/oltp.lua --oltp_tables_count=50 --oltp-table-size=10000000 --rand-init=on prepare
參数说明:
--mysql-db:指定在哪个数据库创建測试表。默觉得sbtest库,须要提前创建好
--num-threads:使用多线程创建多表,节省准备时间
--mysql-engine-trx=yes 支持事务
--mysql-table-engine:指定存储引擎,如myisam。innodb,heap,ndbcluster,bdb,maria,falcon,pbxt 默认InnoDB
--test=tests/db/oltp.lua 表示调用 tests/db/oltp.lua 脚本进行 oltp 模式測试
--oltp_tables_count=10 表示会生成 10 个測试表
--oltp-table-size=1000000 表示每一个測试表填充数据量为 1000000
--db-driver:指定驱动,默觉得Mysql
--rand-init=on 表示每一个測试表都是用随机数据来填充的
#使用1000个线程開始測试,读写模式。
模拟 对50个表并发OLTP測试,每一个表1000万行记录,持续压測时间为 1小时
[root@localhost sysbench_0.5]# sysbench --mysql-engine-trx=yes --mysql-table-engine=innodb --mysql-host=localhost --mysql-port=3307 --mysql-user=root --mysql-password= --mysql-socket=/data1/lib/mysql/mysql.sock --test=sysbench/tests/db/oltp.lua --oltp_tables_count=50
--oltp-table-size=100000000 --num-threads=1000 --oltp-read-only=off --report-interval=10 --rand-type=uniform --max-time=3600 --max-requests=0 --percentile=95 run >>/data1/sysbench-rw.txt
參数说明
--oltp-read-only=off 表示不要进行仅仅读測试,也就是会採用读写混合模式測试
--report-interval=10 表示每10秒输出一次測试进度报告
--rand-type=uniform:数据分布模式,special表示存在热点数据,uniform表示非热点数据模式: uniform(固定),gaussian(高斯),special(特定的),pareto(帕累托)
--max-time=3600 表示最大运行时长为 3600秒
--max-requests=0 表示总请求数为 0,由于上面已经定义了总运行时长,所以总请求数能够设定为 0;也能够仅仅设定总请求数,不设定最大运行时长
--percentile=95 表示设定採样比例。默认是 95%,即丢弃5%的长请求。在剩余的95%里取最大值
可选參数:
--oltp-point-selects:在一个事务里面Point select的数量,默觉得10
--oltp-range-size:range查询的范围大小。默认100。应该小于oltp-table-size
--oltp-simple-ranges:在一个事务里面简单range查询的数量,默认1
--oltp-sum-ranges:在一个事务里面SUM range查询的数量,默认1
--oltp-order-ranges:在一个事务里面ORDER range查询的数量。默认1
--oltp-distinct-ranges:在一个事务里面DISTINCT range查询的数量,默认1
注意:我这里将測试中输出信息存放到一个文本文件中。便于用监控展示成图表形式,这样更直观
监控结果:
PCIe固态存储-IO
HDD-IO
PCIe固态存储-TPS
HDD-TPS
PCIe固态存储-writes
HDD-Writes
PCIe固态存储-reads
HDD-Reads
PCIe固态存储-Response-time
HDD-Response_time
PCIe固态存储-errors
HDD-Errors
结论:(监控參数同样的情况下--oltp_tables_count=50 --oltp-table-size=100000000 --num-threads=1000 --oltp-read-only=off --rand-type=uniform )
TPS:MySQL在PCIe固态存储上执行是在HDD上执行的5.63倍
writes:MySQL在PCIe固态存储上执行是在HDD上执行的5.58倍
reads:MySQL在PCIe固态存储上执行是在HDD上执行的5.55倍
Response_time:MySQL在PCIe固态存储上执行比在HDD上执行响应时间快44.45倍
Errors:MySQL在PCIe固态存储上执行是在HDD上执行错误率低83.5倍
2、随机IO測试(这里就不再上图了)
数据准备(创建70G文件)注意:文件大小须要大于内存大小
sysbench --test=fileio --file-total-size=70G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 prepare
測试阶段
sysbench --test=fileio --file-total-size=70G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
清楚測试数据
sysbench --test=fileio --file-total-size=70G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 clean
随机读写混合
PCIe固态存储
Operations performed: 1789098 reads, 1192732 writes, 3816704 Other= 6798534 Total
Read 27.299Gb Written 18.2Gb Total transferred 45.499Gb (155.3Mb/sec)
9939.43 Requests/sec executed
General statistics:
total time: 300.0001s
total number of events: 2981830
total time taken by event execution: 214.9376s
response time:
min: 0.00ms
avg: 0.07ms
max: 7.26ms
approx. 95 percentile: 0.23ms
Threads fairness:
events (avg/stddev): 2981830.0000/0.00
execution time (avg/stddev): 214.9376/0.00
HDD
Operations performed: 85851 reads, 57234 writes, 183040 Other =326125 Total
Read 1.31Gb Written 894.28Mb Totaltransferred 2.1833Gb (7.4523Mb/sec)
476.95 Requests/sec executed
General statistics:
total time: 300.0024s
total number of events: 143085
total time taken by event execution: 291.8164s
response time:
min: 0.01ms
avg: 2.04ms
max: 170.33ms
approx. 95 percentile: 5.22ms
Threads fairness:
events (avg/stddev): 143085.0000/0.00
execution time (avg/stddev): 291.8164/0.00
随机写
PCIe固态存储
Operations performed: 0 reads, 10441500 writes, 13365074 Other =23806574 Total
Read 0b Written 159.32Gb Totaltransferred 159.32Gb (271.91Mb/sec)
17402.24 Requests/sec executed
General statistics:
total time: 600.0090s
total number of events: 10441500
total time taken by event execution: 168.8168s
response time:
min: 0.00ms
avg: 0.02ms
max: 0.71ms
approx. 95 percentile: 0.02ms
Threads fairness:
events (avg/stddev): 10441500.0000/0.00
execution time(avg/stddev): 168.8168/0.00
HDD
Operationsperformed: 0 reads, 427200 writes,546689 Other = 973889 Total
Read 0b Written 6.5186Gb Total transferred 6.5186Gb (11.125Mb/sec)
712.00 Requests/sec executed
Generalstatistics:
total time: 600.0002s
total number of events: 427200
total time taken by event execution:10.5053s
response time:
min: 0.01ms
avg: 0.02ms
max: 29.30ms
approx. 95 percentile: 0.03ms
Threadsfairness:
events (avg/stddev): 427200.0000/0.00
execution time (avg/stddev): 10.5053/0.00
随机读
PCIe固态存储
Operationsperformed: 3898994 reads, 0 writes, 0Other = 3898994 Total
Read59.494Gb Written 0b Total transferred 59.494Gb (203.07Mb/sec)
12996.64Requests/sec executed
Generalstatistics:
total time: 300.0001s
total number of events: 3898994
total time taken by event execution:294.7603s
response time:
min: 0.00ms
avg: 0.08ms
max: 30.09ms
approx. 95 percentile: 0.24ms
Threadsfairness:
events (avg/stddev): 3898994.0000/0.00
execution time (avg/stddev): 294.7603/0.00
HDD
Operationsperformed: 131643 reads, 0 writes, 0Other = 131643 Total
Read2.0087Gb Written 0b Total transferred 2.0087Gb (6.8564Mb/sec)
438.81 Requests/sec executed
Generalstatistics:
total time: 300.0014s
total number of events: 131643
total time taken by event execution:299.7703s
response time:
min: 0.00ms
avg: 2.28ms
max: 121.94ms
approx. 95 percentile: 5.34ms
Threadsfairness:
events (avg/stddev): 131643.0000/0.00
execution time (avg/stddev): 299.7703/0.00
结论:
PCIe固态存储随机读写IO处理能力是HDD随机读写IO处理能力的20倍
版权声明:本文博客原创文章,博客,未经同意,不得转载。
PCIe固态存储和HDD常见的硬盘性能对比测试的更多相关文章
- 机械硬盘与SSD固态硬盘性能的深度
从7200转硬盘升级到10000转的迅猛龙,那叫量变.从10000转的迅猛龙升级到SSD,这个叫质变.2者的差距是有些地方相当大,而有些却很接近,主要是难比较. 经常听到有人说:我买2个黑盘组RAID ...
- 搞定INTEL快速存储技术(用SSD硬盘做缓存加速)
给朋友买了个联想 ideapad s400超级本,还真是锻炼我的idea啊,原机不带WIN7系统,所以只好自己动手装WIN7,并打开24G SSD硬盘做缓存. 一.用常规方法GHOST了一个WIN7系 ...
- 硬核评测:企业上云的极速存储挑战,华为云全新极速IO云硬盘性能评测
来源:至顶网 作者:董培欣 借助华为云全新一代极速IO云硬盘开启邀测的时机,至顶网评测实验室展开了一次华为云极速IO云硬盘与超高IO云硬盘的性能对比测试活动,并且尝试通过相关测试成绩,对云硬盘的应用能 ...
- CPU 硬盘性能
CPU 硬盘性能到底相差多少 本文以一个现代的.实际的个人电脑为对象,分析其中CPU(Intel Core 2 Duo 3.0GHz)以及各类子系统的运行速度——延迟和数据吞吐量.通过粗略的估算PC各 ...
- dd测试硬盘性能
下面直接介绍几种常见的DD命令,先看一下他的区别~ dd bs=64k count=4k if=/dev/zero of=testdd bs=64k count=4k if=/dev/zero of= ...
- hdparm测试硬盘性能
<1>Centos安装hdparm测试硬盘性能 一.安装hdparm yum install hdparm -y Linux学习,http:// linux.it.net.cn 二.评估读 ...
- 用好lua+unity,让性能飞起来——关于《Unity项目常见Lua解决方案性能比较》的一些补充
<Unity项目常见Lua解决方案性能比较>,这篇文章对比了现在主流几个lua+unity的方案 http://blog.uwa4d.com/archives/lua_perf.html ...
- Linux硬盘性能检测
对于现在的计算机来讲,整个计算机的性能主要受磁盘IO速度的影响,内存.CPU包括主板总线的速度已经很快了. 基础检测方法 1.dd命令 dd命令功能很简单,就是从一个源读取数据以bit级的形式写到一个 ...
- HDD + HDD(SSD) 多硬盘系统启动问题
一.问题描述 最近购一了款有预留msata接口的hp电脑,买回来开始折腾SSD和内存的问题,内存一次性就解决了:但SSD在安装过程中遇到三个问题,分别是: 无螺丝,无法固定固态硬盘(后在一个旧鼠标上弄 ...
随机推荐
- dba_dependencies查询结果视图
[oracle@rhel63single ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 13 0 ...
- ERROR 2003 (HY000): Can't connect to MySQL server on '10.16.115.101' (111)
ubuntu安装之后mysql,使用apt-get安装命令,默认为同意只本地访问 root@idata1:~/software# mysql -uroot -p123456 -h10.16.115.1 ...
- POJ 2531-Network Saboteur(DFS)
Network Saboteur Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9435 Accepted: 4458 ...
- Android适配方案小结(一)
相关计量单位介绍: px:是屏幕的像素点,不同设备显示的效果一样. in:英寸(1英寸等于2.54cm) mm:毫米 pt:磅, 1/72英寸 dp:device independent pixels ...
- ER模型
一.什么是ER模型 实体-联系图(Entity-RelationDiagram)用来建立数据模型,在数据库系统概论中属于概念设计阶段,形成一个独立于机器.独立于DBMS的ER图模型.通常将它简称为ER ...
- Android四种Activity的加载模式(转)
建议首先阅读下面两篇文章,这样才可以更好的理解Activity的加载模式: Android的进程,线程模型: http://www.cnblogs.com/ghj1976/archive/2011/0 ...
- Windows下一个MySQL有些错误的解决方法
1.无论是什么提示.我们有一个直接看错误日志.由于它描述了最具体描述错误日志. 于MySQL安装文件夹中找到 my.ini简介 看日志保存路径 2. 我的错误是[ERROR] Fatal error: ...
- JavaEE(20) - Web层和EJB的整合(Entity Manager)
1. 使用容器管理的EntityManager 2. 使用应用程序管理的EntityManager 3. 使用ThreadLocal保证EntityManager的线程安全 4. EAO封装JPA 5 ...
- JAVA web四个属性的范围汇总
首先,你需要知道client跳跃和server差别: client跳转: response.sendRedict(String path),地址栏发生改变. 不能传递request属性. server ...
- Matrix (二维树状数组)
Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the ...