9(九)Jmeter如何连接数据库

张开发
2026/4/10 7:52:11 15 分钟阅读

分享文章

9(九)Jmeter如何连接数据库
下载安装插件mysql-connector-java-5.1.44链接https://pan.baidu.com/s/1aLO7R8nW_Q-1NCC1jp9gIA提取码v130添加组件添加组件JDBC Connection Configuration用于连接数据库添加组件JDBC Request用于填写sql和配置参数JDBC Connection Configuration相关配置重要参数说明Variable Name for created pool 数据库连接池的名称我们可以有多个jdbc connection configuration每个可以起个不同的名称在jdbc request中可以通过这个名称选择合适的连接池进行使用。Max Number of Connections 该数据库连接池的最大连接数一般可设置为0意思是每个线程都使用单独的数据库连接线程之间数据库连接不共享中文池中允许的最大连接数。在大多数情况下将其设置为0这意味着每个线程将得到它自己的池其中只有一个连接即线程之间不共享连接。如果您真的想要使用共享池(为什么?)那么将max count与线程数相同以确保线程不会相互等待。原文aximum number of connections allowed in the pool. In most cases, set this to zero (0) . This means that each thread will get its own pool with a single connection in it, i.e. the connections are not shared between threads. If you really want to use shared pooling (why?), then set the max count to the same as the number of threads to ensure threads don’t wait on each other.Max Wait (ms) 在连接池中取回连接最大等待时间中文如果在试图检索连接过程中取回连接超过所设置期限连接池抛出一个错误原文ool throws an error if the timeout period is exceeded in the process of trying to retrieve a connectionTime Between Eviction Runs (ms) 疏散时间中文在空闲对象驱逐线程运行期间可以休眠的毫秒数。当非正值时将运行无空闲对象驱逐器线程。(默认为“60000”1分钟)如果当前连接池中某个连接在空闲了time Between Eviction Runs Millis时间后任然没有使用则被物理性的关闭掉。原文The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. (Defaults to 60000 , 1 minute)Auto Commit 自动提交sql语句中文打开或关闭连接的自动提交。原文Turn auto commit on or off for the connections.

更多文章