【sysbench】point_select测试方法与脚本

测试工具

Sysbench 是一个基于 LuaJIT 的可编写脚本的多线程基准测试工具。它最常用于数据库基准测试,但也可用于创建不涉及数据库服务器的任意复杂工作负载,本次测试将采用Sysbench 的多线程测试功能对AtomData OP版进行了读写模式的性能测试

工具安装

详见:https://www.cnblogs.com/syw20170419/p/16145808.html  链接中的“下载安装”

参数设置

--table_size(行)

1000,0000/1,0000,0000/5,0000,0000

--tables

100

--threads

4/8/16/32/64/128/256/512/1024

--time

600

--report-interval

10

--db-ps-mode

disable

测试语法

SELECT c FROM sbtest%u WHERE id=?

建表结构

Create Table `sbtest1` (
 `id` bigint NOT NULL AUTO_INCREMENT,
 `k` int NOT NULL DEFAULT '0',
 `c` varchar NOT NULL DEFAULT '',
 `pad` varchar NOT NULL DEFAULT '',
 primary key (id)
) DISTRIBUTE BY HASH(`id`) INDEX_ALL='Y'

测试方法

  • 1000,0000的测试,100张表,每张表中有10,0000行数据
  • 1,0000,0000的数据,100张表,每张表中有500,0000行数据
  • 5,0000,0000的数据,100张表,每张表中有100,0000行数据
  • 每个数据量均按照不同的并发1/4/8/16/32/64/128/256/512进行测试
  • 利用写好的sysbench.sh脚本,直接运行测试,将测试结果进行记录并保存

测试指标

TPS、QPS、RT

测试脚本

#生成数据
sysbench /usr/share/sysbench/oltp_read_only.lua --tables=100 --threads=10 --table_size=5000000 --mysql-host=192.168.30.118 --mysql-port=3001 --mysql-db=syw_insert --mysql-user=kepler --mysql-password=Aa123456 --report-interval=10 prepare
#运行测试
sysbench /usr/share/sysbench/oltp_read_only.lua --tables=100 --threads=1 --table_size=800000 --time=600 --mysql-host=192.168.30.118 --mysql-port=3001 --mysql-db=syw_insert --mysql-user=kepler --mysql-password=Aa123456 --report-interval=10 --db-ps-mode=disable run
#删除数据
sysbench /usr/share/sysbench/oltp_read_only.lua --tables=100 --threads=1 --table_size=800000 --mysql-host=192.168.30.118 --mysql-port=3001 --mysql-db=syw_insert --mysql-user=kepler --mysql-password=Aa123456 --report-interval=10  --verbosity=5 cleanup

测试结果

制图方法和展示,详细read_only中的写法:https://www.cnblogs.com/syw20170419/p/16261768.html

 
posted @ 2022-05-12 11:42  Syw_文  阅读(276)  评论(0编辑  收藏  举报