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在安装过程中遇到三个问题,分别是: 无螺丝,无法固定固态硬盘(后在一个旧鼠标上弄 ...
随机推荐
- 使用jprobe建设镜面层叠的原则和见解
忽然想起的回忆,那是2007上周五在冬季,我看我的老湿调试Linux堆IP层,只看到他改变路由查找的逻辑,然后直接make install上的立竿见影的效果有点,我只知道,,这种逻辑必须再次更改编译内 ...
- C# 字符串知识整理
新知识点,只是对于本人来说而已. 系统处理文本的方式 [新知识点].NET Framework .NET Framework的定义:其包含了一个公共语言运行时(Common Language Runt ...
- 【C++知识汇总】运营商 & 运算符重载
[运算符] 在进行运算时,假设右括号的话我们知道先运算哪个,那假设没有括号了.算术运算符,关系运算符,逻辑运算符,位运算符.赋值运算符,++.--运算符等等,那么多的运算符.我们先算哪边 ...
- RH253读书笔记(8)-Lab 8 Securing Data
Lab 8 Securing Data Goal: Gain familiarity with encryption utilities Sequence 1: Using SSH keys with ...
- 大话设计模式C++实现-文章7章-代理模式
一个.UML画画 二.概念 代理模式:为其它对象提供一种代理以控制对这个对象的訪问. 三.应用场景 (1)远程代理.也就是为一个对象在不同的地址空间提供局部代表.这样能够隐藏一个对象存在于不同地址空间 ...
- 当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法(转)
对象的synchronized方法不能进入了,但它的其他非synchronized方法还是可以访问的 对每一个class只有一个thread可以执行synchronized static method ...
- AndroidUI组件之TabHost
package com.gc.tabhost; /** * @author Android将军 * * * * 1.TabHost是一种非常有用的组件,TabHost能够非常方便地在窗体上放置 * 多 ...
- 7 Ways to earn money on programming(转)
英文原文:7 Ways to earn money on programming 几个星期前,当我收到一个自称 Someone712 的人发给我的一条消息时,我决定要写一篇如何用编程赚钱的博客文章.S ...
- OAuth和OpenID的区别(转)
OAuth(开放授权)是一个开放标准,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用. OAuth协议为用户资源的授权提 ...
- MLAPP——概率机器学习知识汇总
<机器学习>课程使用Kevin P. Murphy图书<Machine Learning A Probabilistic Perspective>本英语教材,本书从一个独特的数 ...