利用sysbench进行MySQL OLTP基准测试
[root@zlm1 :: ~]
#cd /vagrant [root@zlm1 :: ~]
#wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip"
[root@zlm1 :: /vagrant]
#cp -R sysbench-1.0 ~ [root@zlm1 :: ~]
#cd sysbench-1.0/ [root@zlm1 :: ~/sysbench-1.0]
#./autogen.sh
./autogen.sh: running `libtoolize --copy --force'
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
./autogen.sh: running `aclocal -I m4'
./autogen.sh: running `autoheader'
./autogen.sh: running `automake -c --foreign --add-missing'
configure.ac:: installing 'config/ar-lib'
configure.ac:: installing 'config/compile'
configure.ac:: installing 'config/config.guess'
configure.ac:: installing 'config/config.sub'
configure.ac:: installing 'config/install-sh'
configure.ac:: installing 'config/missing'
src/Makefile.am: installing 'config/depcomp'
parallel-tests: installing 'config/test-driver'
./autogen.sh: running `autoconf'
Libtoolized with: libtoolize (GNU libtool) 2.4.
Automade with: automake (GNU automake) 1.13.
Configured with: autoconf (GNU Autoconf) 2.69 [root@zlm1 :: ~/sysbench-1.0]
#./configure && make && make install
//Omitted.
[root@zlm1 :: ~/sysbench-1.0]
#sysbench --version
sysbench: error while loading shared libraries: libmysqlclient.so.: cannot open shared object file: No such file or directory [root@zlm1 :: ~/sysbench-1.0]
#whereis sysbench
sysbench: /usr/local/bin/sysbench [root@zlm1 :: ~/sysbench-1.0]
#ldd /usr/local/bin/sysbench
linux-vdso.so. => (0x00007fff2abfe000)
libmysqlclient.so. => not found //Only lack this lib.
libpthread.so. => /lib64/libpthread.so. (0x00007f86e2986000)
librt.so. => /lib64/librt.so. (0x00007f86e277e000)
libdl.so. => /lib64/libdl.so. (0x00007f86e257a000)
libaio.so. => /lib64/libaio.so. (0x00007f86e2377000)
libm.so. => /lib64/libm.so. (0x00007f86e2075000)
libgcc_s.so. => /lib64/libgcc_s.so. (0x00007f86e1e5f000)
libc.so. => /lib64/libc.so. (0x00007f86e1a9d000)
/lib64/ld-linux-x86-.so. (0x00007f86e2bab000) [root@zlm1 :: ~/sysbench-1.0]
#find / -name libmysqlclient //There's no result found. [root@zlm1 :: ~/sysbench-1.0]
#
[root@zlm1 :: ~/sysbench-1.0]
#vim /etc/ld.so.conf.d/mysql.conf [root@zlm1 :: ~/sysbench-1.0]
#cat /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib [root@zlm1 :: ~/sysbench-1.0]
#ldconfig [root@zlm1 :: ~/sysbench-1.0]
#ldd /usr/local/bin/sysbench
linux-vdso.so. => (0x00007fff767fe000)
libmysqlclient.so. => /usr/local/mysql/lib/libmysqlclient.so. (0x00007fb2ca8a8000)
libpthread.so. => /lib64/libpthread.so. (0x00007fb2ca68b000)
librt.so. => /lib64/librt.so. (0x00007fb2ca483000)
libdl.so. => /lib64/libdl.so. (0x00007fb2ca27f000)
libaio.so. => /lib64/libaio.so. (0x00007fb2ca07d000)
libm.so. => /lib64/libm.so. (0x00007fb2c9d7a000)
libgcc_s.so. => /lib64/libgcc_s.so. (0x00007fb2c9b64000)
libc.so. => /lib64/libc.so. (0x00007fb2c97a3000)
libstdc++.so. => /lib64/libstdc++.so. (0x00007fb2c949b000)
/lib64/ld-linux-x86-.so. (0x00007fb2caec7000) [root@zlm1 :: ~/sysbench-1.0]
#sysbench --version
sysbench 1.0.
[root@zlm1 :: ~/sysbench-1.0/src/lua]
#ls -l
total
-rwxr-xr-x root root Jul : bulk_insert.lua
drwxr-xr-x root root Jul : internal
-rw-r--r-- root root Jul : Makefile
-rwxr-xr-x root root Jul : Makefile.am
-rw-r--r-- root root Jul : Makefile.in
-rwxr-xr-x root root Jul : oltp_common.lua
-rwxr-xr-x root root Jul : oltp_delete.lua
-rwxr-xr-x root root Jul : oltp_insert.lua
-rwxr-xr-x root root Jul : oltp_point_select.lua
-rwxr-xr-x root root Jul : oltp_read_only.lua
-rwxr-xr-x root root Jul : oltp_read_write.lua
-rwxr-xr-x root root Jul : oltp_update_index.lua
-rwxr-xr-x root root Jul : oltp_update_non_index.lua
-rwxr-xr-x root root Jul : oltp_write_only.lua
-rwxr-xr-x root root Jul : select_random_points.lua
-rwxr-xr-x root root Jul : select_random_ranges.lua
sysbench [options]... [testname] [command]
Commands implemented by most tests: prepare run cleanup help
//Common Options.
--threads //Specify the threads to use(default 1).
--time //Specify the execution time in seconds(default 10s).
--events //Specify the number of events(default 0).
--rate //Speicify the transactions rate(default 0).
--db-driver //Specify the database driver(default mysql).
--rand-type //Specify the random numbers distribution(defautl "special",others "uniform","gaussian","pareto").
--warmup-time //Specify the time to warmup before real execution to avoid inaccurate result(default 0).
--report-interval //Specify the time about the report interval(default 0,means disable intermediate report).
--table //Specify the number of tables in test database.
--table-size //Specify the number of records in each test table. //MySQL Driver Options.
--mysql-host //Specify the host(default localhost).
--mysql-port //Specify the port(default 3306).
--mysql-socket //Specify the socket.
--mysql-user //Default sbtest.
--mysql-password //Specify the password of user.
--mysql-db //Specify the test db(default sbtest).
--mysql-dry-run //It does not really run but treat MySQL client API calls are successful. //Command Options(depends on "testname").
prepare //creates necessary files or data that the peticular test need.
run //actually runs the specific test which is specified by "testname" option.
cleanup //Removes all the test files or data which are relevant with.
help //Shows the information of particular test.
[root@zlm1 :: ~/sysbench-1.0/src/lua]
#sysbench oltp_read_write.lua --mysql-host=192.168.56.100 --mysql-port= --mysql-user=zlm --mysql-password=aaron8219 --mysql-db=sysbench --tables= --table-size= --mysql-storage-engine=innodb prepare
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Creating table 'sbtest1'...
Inserting records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
Creating table 'sbtest4'...
Inserting records into 'sbtest4'
Creating a secondary index on 'sbtest4'...
Creating table 'sbtest5'...
Inserting records into 'sbtest5'
Creating a secondary index on 'sbtest5'...
Creating table 'sbtest6'...
Inserting records into 'sbtest6'
Creating a secondary index on 'sbtest6'...
Creating table 'sbtest7'...
Inserting records into 'sbtest7'
Creating a secondary index on 'sbtest7'...
Creating table 'sbtest8'...
Inserting records into 'sbtest8'
Creating a secondary index on 'sbtest8'...
Creating table 'sbtest9'...
Inserting records into 'sbtest9'
Creating a secondary index on 'sbtest9'...
Creating table 'sbtest10'...
Inserting records into 'sbtest10'
Creating a secondary index on 'sbtest10'... //Create 10 tables with 10w rows each.
[root@zlm1 :: ~/sysbench-1.0/src/lua]
#
[root@zlm1 :: ~/sysbench-1.0/src/lua]
#sysbench oltp_read_write.lua --mysql-host=192.168.56.100 --mysql-port= --mysql-user=zlm --mysql-password=aaron8219 --mysql-db=sysbench --threads= --time= --warmup-time= --report-interval= --rand-type=uniform run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) invalid option: --warmup-time= //It's not supported in my version. [root@zlm1 :: ~/sysbench-1.0/src/lua]
#sysbench oltp_read_write.lua --mysql-host=192.168.56.100 --mysql-port= --mysql-user=zlm --mysql-password=aaron8219 --mysql-db=sysbench --threads= --time= --report-interval= --rand-type=uniform run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads: //There're three threads.
Report intermediate results every second(s) //Show report every 10s.
Initializing random number generator from current time Initializing worker threads... Threads started! [ 10s ] thds: tps: 134.07 qps: 2684.74 (r/w/o: 1879.80/536.59/268.34) lat (ms,%): 48.34 err/s: 0.00 reconn/s: 0.00 //Notice the low value here.
[ 20s ] thds: tps: 273.74 qps: 5473.50 (r/w/o: 3831.29/1094.64/547.57) lat (ms,%): 15.00 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: tps: 273.30 qps: 5467.40 (r/w/o: 3827.60/1093.20/546.60) lat (ms,%): 14.73 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: tps: 250.50 qps: 5009.82 (r/w/o: 3506.61/1002.20/501.00) lat (ms,%): 17.95 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: tps: 261.07 qps: 5222.57 (r/w/o: 3656.33/1044.09/522.15) lat (ms,%): 16.41 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: tps: 264.52 qps: 5289.24 (r/w/o: 3702.14/1058.07/529.03) lat (ms,%): 15.55 err/s: 0.00 reconn/s: 0.00
SQL statistics:
queries performed:
read: //Executions of writing.
write: //Executions of reading.
other: //Operations excetp CURD.
total:
transactions: (242.76 per sec.) //TPS is 242.
queries: (4855.30 per sec.) //QPS is 4855.
ignored errors: (0.00 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .0155s
total number of events: //Total transactions. Latency (ms):
min: 3.17
avg: 12.35
max: 887.76
95th percentile: 16.41 //Response time of former 95%
sum: 179957.65 Threads fairness: //Statistics of concurrency.
events (avg/stddev): 4856.6667/21.23
execution time (avg/stddev): 59.9859/0.00 [root@zlm1 :: ~/sysbench-1.0/src/lua]
#
- sysbench is more powerful than mysqlslap(built-in program of MySQL).
- Be ware of the diffrence between database benchmark test and presure test.
- There're also some other tools can be used to test database performance such as mysql-tpcc,YCSB,etc.
- Database benchmark really helps us to have a explicit overview about our newly arrived server.More test is necessary.
利用sysbench进行MySQL OLTP基准测试的更多相关文章
- Sysbench对Mysql进行基准测试
前言 1.基准测试(benchmarking)是性能测试的一种类型,强调的是对一类测试对象的某些性能指标进行定量的.可复现.可对比的测试. 进一步来理解,基准测试是在某个时候通过基准测试建立一个已知的 ...
- mysql benchmark基准测试
git项目地址: https://github.com/akopytov/sysbench 利用sysbench很容易对mysql做性能基准测试(当然这个工具很强大,除了测试主流数据库性能,还能测试其 ...
- 使用sysbench对mysql压力测试
sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.关于这个项目的详细介绍请看:https://github.com/akopytov/sy ...
- sysbench(mysql测试工具 )
目录 一.基准测试简介 1.什么是基准测试 2.基准测试的作用 3.基准测试的指标 4.基准测试的分类 二.sysbench 1.sysbench简介 2.sysbench安装 3.sysbench语 ...
- MySQL服务器基准测试
一.基准测试简介 1.什么是基准测试 数据库的基准测试是对数据库的性能指标进行定量的.可复现的.可对比的测试. 基准测试与压力测试 基准测试可以理解为针对系统的一种压力测试.但基准测试不关心业务逻辑, ...
- OLTP基准测试脚本
关键语句:ll /local/sysbenchtest/sysbench-0.5/sysbench/tests/db--查看lua脚本/usr/local/mysql/bin/mysql -u roo ...
- sysbench 0.5 oltp测试笔记
sysbench 0.5相比0.4版本的主要变化是,oltp测试结合了lua脚本,不需要修改源码,通过自定义lua脚本就可以实现不同业务类型的测试.同时0.5相比0.4需要消耗更多的cpu资源. 1. ...
- 使用 sysbench对mysql进行压力测试介绍之一
sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试.数据库目前支持MySQL/Oracle/PostgreSQL.本文只是简单演示一下几种测试的用 ...
- 利用sysbench工具测试MHA
利用sysbench工具测试MHA 1. sysbench准备数据 2. sysbench开始压测 3. master模拟意外宕机 4. mysqldb2 上观察mha状态 5. 手工failover ...
随机推荐
- IDEA部署Express工程
1.下载并安装Nodejs 2.通过Nodejs的NPM工具安装全局安装express工具,命令如下: npm install -g express@XXX npm install -g expres ...
- Zookeeper分布式集群部署
ZooKeeper 是一个针对大型分布式系统的可靠协调系统:它提供的功能包括:配置维护.名字服务.分布式同步.组服务等: 它的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效.功能稳定的 ...
- 详解在Hibernate中配置数据库方言的作用和好处以及各种数据库的方言连接
Hibernate底层依然使用SQL语句来执行数据库操作,虽然所有关系型数据库都支持使用标准SQL语句,但所有数据库都对标准SQL进行了一些扩展,所以在语法细节上存在一些差异,因此Hibernate需 ...
- 随机练习:C#实现维吉尼亚加密与解密(解密前提为已知密匙)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 修复kindEditor点击加粗, 内容焦点跳动的问题
大概1560~1569行 pos : function() { var self = this, node = self[0], x = 0, y = 0; if (node) { if (node. ...
- Mybatis通用Mapper(转)
转自:http://blog.csdn.net/isea533/article/details/41457529 极其方便的使用Mybatis单表的增删改查 项目地址:http://git.oschi ...
- 快速配置$XX_TOP方法
查找配置文件名 执行:env | grep CONTEXT 得到: CONTEXT_FILE=/dev01/oracle/UAT/inst/apps/UAT_ksebsdt/appl/admin/UA ...
- js 判断浏览器类型
前言 工作中需要用到判断浏览器类型,网上找到的内容不怎么全,故在此进行一下总结. 一.不同浏览器及版本下User-Agent信息 待续.....欢迎补充 二.根据User-Agent信息进行判断 参考 ...
- centos6.5 网卡配置
家里用的电脑是电信拨号的 所以用不了桥接模式 改用nat vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" HW ...
- Moodle-3.1.2 (Ubuntu 16.04 )
平台: Ubuntu 类型: 虚拟机镜像 软件包: moodle-3.1.2 commercial education moodle open-source 服务优惠价: 按服务商许可协议 云服务器费 ...