下载DBT2 Benchmark,编译安装,按照README-MYSQL中的步骤来操作。报告的时间是客户端的经过时间,不是在服务器端的CPU时间。执行BENCHMARK()若干次可能是明智的,并且注意服务器机器的负载有多重来解释结果。需要由aclocal、autoheader、autoconf、automake,以及mysql、mysql-libs、mysql-devel。
$ ./congigure --with-mysql
$ make
$ sudo make install
安装好datagen,然后生成数据,需要先创建对应的目录如/tmp/dbt2-w3。
$ datagen -w 3 -d /tmp/dbt2-w3 --mysql
warehouses = 3
first warehouse = 1
districts = 10
customers = 3000
items = 100000
orders = 3000
stock = 100000
new_orders = 900
生成完数据后就可以执行scripts/mysql/mysql_load_db.sh脚本将数据导入到数据库中。
benchmark 使用方法:
这里还有一种方法能够获取到 mysql 执行一个sql 语句或sql 表达式的 时间,并且可以由用户指定执行次数。通过执行大规模次数, 才能够获得比较稳定的 sql 执行时间。
select benchmark(num, exp) ; 其中 num 为执行次数,exp 为希望获得执行时间的表达式 ,不包括 sql 语句
select benchmark(1, to_days(2011-04-07) - to_days(now()) <1 ); 执行时间大概是 0.0011秒 ,可以计算表达式时间
select benchmark(1, select * from MYTABLE limit 0,40 ); Mysql 报错,说明EXP 不能为sql 语句,只能为表达式或函数
下面是对num 赋予不同的数值,查看执行不同次数所耗费的时间
select benchmark(100, to_days(2011-04-07) - to_days(now()) <1 ); 执行时间大概也是 0.0012秒
select benchmark(10000, to_days(2011-04-07) - to_days(now()) <1 ); 执行时间大概也是 0.0056秒
select benchmark(1000000, to_days(2011-04-07) - to_days(now()) <1 ); 执行时间大概也是 0.4454秒
为什么执行100次和执行 1次的时间耗费差不多呢? 这是因为可能被注入了缓存的缘故,因此benchmark 不能用来完成一种实际的 基准测试。
The DBT2 Benchmark Tool can be used to run automated benchmarks for MySQL and MySQL Cluster. It supports three types of benchmarks:
DBT2
SysBench
flexAsynch
It has been primarily used on Linux x86_64 platforms, but occasional benchmarks have also been run on Solaris and Windows. It can be used to test MySQL based on MySQL 5.6 and MySQL 5.7 Releases (older versions might work as well but isn't maintained any more).
DBT2 is an open source benchmark that mimics an OLTP application for a company owning large amounts of warehouses. It contains transactions to handle New Orders, Order Entry, Order Status, Payment and Stock handling. The transactions are a mix of read and write transactions. Using MySQL the benchmark tests a single MySQL Server instance. Using MySQL Cluster the benchmark tool can drive large distributed tests with many MySQL Cluster Data nodes and MySQL Server instances. The DBT2 Benchmark Tool provides scripts to automate execution of these benchmarks.
The DBT2 tarball also contains a benchmark tool using PowerShell on Windows to run sysbench on Windows. There is also scripts mimicing top on Windows. Finally there is also a set of simple scripts to use the perf tool on Linux.
FlexAsynch is a benchmark specifically developed to test scalability of MySQL Cluster. It is found in any MySQL Cluster source tarball under storage/ndb/test/ndbapi. The features required to run it in this parallel manner requires a MySQL Cluster 7.x version released after the 15th of October 2011. The DBT2 Benchmark Tool can be used to run distributed tests with many MySQL Cluster Data nodes and many flexAsynch benchmark programs in a completely automated fashion. The latest version of flexAsynch mainly exists in the source tree for the 2 most recent versions.
MySQL Server Version: 5.6 and later
MySQL Cluster Version: MySQL Cluster 7.3 and later
开发者其他应用

七猫免费阅读小说最新版41.6M234049人在玩七猫免费阅读小说下载安装app,七猫免费阅读小说app不一样的小说阅读神器,这里有着海量丰富小说应用资源,你想看的小说通过强大搜索引擎一键搜索即可,主要的是阅读小说还能够获取红包现金奖励哦。
下载
奇热漫画app安卓版25.5M13451人在玩奇热漫画是一款非常不错的漫画阅读软件,具有很多强大的阅读功能,奇热漫画app实时为你更新全网最新最热的动漫资源。平台拥有海量精彩漫画,官方正版漫画
下载
奇热小说app24.8M234499人在玩安卓奇热小说app是专为众多爱看小说的人士提供的手机看小说的软件,省流量极速免费看小说,海量热门小说任你看,喜欢小说的小伙伴不要错过,赶快下载奇热小说网手机版客户端体验吧
下载
2022快看漫画App最新版69.0M51448人在玩2022快看漫画,相信许多玩微博的小伙伴们都已经知道这款APP了。吵架归吵架,至于这款快看漫画App到底做得怎么样,只有试过才知道!
下载
豆瓣阅读客户端app70.2M9579人在玩豆瓣阅读app是一款为豆瓣的用户们量身定做的APP,在豆瓣阅读这里你可以看到更加符合豆瓣用户喜好的各类文字作品,而且目前书籍依然在持续增长中。
下载
追书神器官方版70.1M19679人在玩追书神器2022最新版是一款超级强力的小说导读助手,目前几大热门的小说连载网站均有关联,你可以通过它方便地寻找自己喜欢的书籍。
下载
腾讯动漫71.9M13609人在玩腾讯动漫寒假档,许多大人们认为动漫就是小孩子看的东西,但是大概从80后开始,动漫就成为了许多人生活中的一部分,如果你喜欢看动漫,可以来腾讯动漫吧,这里有最新动漫更新视频
下载
书旗小说免费版本32.7M22553人在玩书旗小说免费版下载安装,书旗小说免费版本是一款以书旗网海量小说为基础的在线/离线阅读器,集合在线阅读、本地阅读、书包下载、自动书签、智能搜索、阅读设置等多项人性化功能。
下载
搜狗阅读器app19.5M6809人在玩搜狗阅读是搜狗公司依托于搜狗搜索的丰富资源,为安卓用户打造的移动阅读应用产品。搜狗阅读海量图书即搜即看,新闻大事掌握在手,更有离线缓存、精品推荐、更新提醒等功能,让您随时随地享受阅读的快乐。
下载
起点读书app新版本202237.2M11875人在玩起点读书app新版本,又名起点看书,是起点中文网推出的一款阅读软件。它支持本地阅读并提供起点在线书库,具备多种格式的解析阅读功能
下载