栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

sysbench测试TiDB数据库

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

sysbench测试TiDB数据库

**

TiDB性能测试

**

建议使用 Sysbench 1.0 或之后的更新版本

软件下载地址

https://github.com/akopytov/sysbench
https://github.com/akopytov/sysbench/archive/1.0.20.tar.gz

安装依赖包

yum -y install gcc gcc-c++ automake make libtool pkgconfig libaio-devel openssl-devel

上传服务器并解压并编译安装sysbench,依次执行如下命令:

tar -zxvf 1.0.16.tar.gz

cd sysbench-1.0.16

./autogen.sh

./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib64/mysql --with-mysql

make -j 2 && make install

踩坑一:
执行./configure --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/bin/ 时报错:
cannot find MySQL client libraries

解决方案:缺少mysql-devel这个库,执行:yum install mysql-devel
安装完成后再次执行…/configure --with-mysql-includes=/usr/local/mysql/include/ ,成功

准备配置文件:tidb-config
mysql-host=10.168.2.xx
mysql-port=4000
mysql-user=root
mysql-password=xxxxxx
mysql-db=test
db-driver=mysql

sysbench安装目录,里面包含了很多脚本:/usr/local/share/sysbench

测试执行

导入数据:
sysbench --config-file=tidb-config oltp_point_select --tables=32 --table-size=10000000 prepare

测试数据准备(实际是创建的表):
sysbench /usr/local/share/sysbench/bulk_insert.lua --config-file=tidb-config --tables=50 --threads=100 --table_size=20000000 --report-interval=10 prepare

批量插入数据(是插入表的数据):
sysbench /usr/local/share/sysbench/oltp_insert.lua --config-file=tidb-config --tables=50 --threads=50 --table_size=2000000 --report-interval=10 run
更新数据:
sysbench /usr/local/share/sysbench/bulk_insert.lua --config-file=tidb-config --tables=50 --threads=50 --table_size=30000000 --report-interval=10 run

查询数据:
sysbench /usr/local/share/sysbench/oltp_read_only.lua --config-file=tidb-config --tables=50 --threads=50 --table_size=30000000 --report-interval=10 run

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/851664.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号