压力测试(四)-Mysql数据库压测实操

时间:2021-11-26 20:56:06

1、Jmeter压测实战之JDBC request压测Mysql讲解

简介:讲解jdbc压测mysql相关准备工作,jar包添加,配置讲解

1、Thread Group -> add -> sampler -> jdbc request

2、jar包添加  mysql-connector-java-5.1.30.jar

3、JDBC connection Configuration 配置

1、JDBC request->add -> config element -> JDBC connection configuration

核心配置

Max Number of connections : 最大连接数

MAX wait :最大等待时间

Auto Commit: 是否自动提交事务

DataBase URL : 数据库连接地址 jdbc:mysql://127.0.0.1:3306/blog

JDBC Driver Class : 数据库驱动,选择对应的mysql

username:数据库用户名

password:数据库密码

2、Jmeter压测实战之JDBC request压测Mysql, select语句

简介:使用jmeter压测mysql,select,insert语句

1、Debug Sampler使用(结果树中查看)

Thread Group -> add -> sampler -> debug sampler

2、参数讲解:(sql结尾不要加";")

1、variable name of pool declared in JDBC connection configuration(和配置文件同名)

2、Query Type 查询类型

3、parameter values 参数值

4、parameter types  参数类型

5、variable names  sql执行结果变量名

6、result variable names 所有结果当做一个对象存储

7、query timeouts  查询超时时间

8、 handle results  处理结果集