mysql tpcc load_centos环境下mysql8.0进行tpcc测试

本文介绍了如何在CentOS环境中,使用tpcc-mysql对MySQL 8.0进行TPCC测试。内容包括源码下载、编译解决依赖问题,以及创建数据库、数据仓库和执行测试的详细步骤。
摘要由CSDN通过智能技术生成

math?formula=%5Ccolor%7Bgreen%7D%7B%E6%96%87%E7%AB%A0%E4%BB%98%E8%B4%B9%E6%98%AF%E5%AF%B9Copyleft%E7%B2%BE%E7%A5%9E%E7%9A%84%E4%BA%B5%E6%B8%8E%EF%BC%8C%E9%98%85%E5%90%8E%E7%82%B9%E8%B5%9E%E3%80%81%E5%85%B3%E6%B3%A8%E6%89%8D%E6%98%AF%E5%AF%B9%E4%BD%9C%E8%80%85%E6%9C%80%E5%A4%A7%E7%9A%84%E5%A5%96%E8%B5%8F%EF%BC%81---Devil%7D

May you do good and not evil.

May you find forgiveness for yourself and forgive others.

May you share freely, never taking more than you give.

math?formula=%5Ccolor%7Bred%7D%7B%E4%B8%8B%E8%BD%BD%E5%B9%B6%E7%BC%96%E8%AF%91tpcc-mysql%7D

1.使用git下载源码

2.编译tpcc-mysql

cd tpcc-mysql/src

make

在编译时候可能遇到的问题及解决办法:

2.1 undefined reference to `mysql_init' 形式的未定义mysql_xxx问题

2.2 can't find mysql.h 问题

解决办法:

[root@localhost ShareDevil]# yum search mysql | grep head

mysql++-devel.x86_64 : MySQL++ developer files (headers, examples, etc.)

mysql-community-devel.i686 : Development header files and libraries for MySQL

mysql-community-devel.x86_64 : Development header files and libraries for MySQL

mysql-connector-c++-devel.x86_64 : Development header files and libraries for

dmlite-dpmhead.x86_64 : EMI DPM Head Node (MySQL)

dmlite-dpmhead-domeonly.x86_64 : DPM Head Node (MySQL)

[root@localhost ShareDevil]# yum install mysql-community-devel.x86_64 //安装开发依赖库和头文件

3.使用tpcc-mysql

3.1 准备工作

[root@localhost tpcc-mysql]# mysql -uroot -p -e "create database tpcc" # 创建测试用的数据库

[root@localhost tpcc-mysql]# mysql -uroot -p tpcc < create_table.sql # 创建测试用的表

[root@localhost tpcc-mysql]# mysql -uroot -p tpcc < add_fkey_idx.sql # 创建FK和索引

3.2 创建五个数据仓库

./tpcc_load -h127.0.0.1 -dtpcc -uroot -prootpasswd -w5

3.3 测试

./tpcc_start -h 127.0.0.1 -P 3306 -d tpcc -u root -p rootpasswd -w 5 -c 5 -r 120 -l 300 - >tpcc-output-log

各个参数用法如下:

-h server_host: 服务器名

-P port : 端口号,默认为3306

-d database_name: 数据库名

-u mysql_user : 用户名

-p mysql_password : 密码

-w warehouses: 仓库的数量

-c connections : 线程数,默认为1

-r warmup_time : 热身时间,单位:s,默认为10s , 热身是为了将数据加载到内存。(真实测试中建议热身时间不低于5分钟)

-l running_time: 测试时间,单位:s,默认为20s

-i report_interval: 指定生成报告间隔时长(真实测试中不低于30min)

-f report_file: 测试结果输出文件(一般命名为xxx.log)

-t trx:输出文件

- > out1: 将控制台输出存入文件out1中

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值