proxool连接池的一些参数

摘要:
house-keeping-sleep-time:housekeeper保留线程处于睡眠状态的最长时间,housekeeper的职责就是检查各个连接的状态,并判断是否需要销毁或者创建,这个的默认值是30秒。house-keeping-test-sql:如果发现了空闲的数据库连接.housekeeper将会用这个语句来测试.这个语句最好非常快的被执行.如果没有定义,测试过程将会被忽略。maximum-active-time:如果housekeeper检测到某个线程的活动时间大于这个数值.它将会杀掉这个线程.所以确认一下你的服务器的带宽.然后定一个合适的值.默认是5分钟。

house-keeping-sleep-time: house keeper 保留线程处于睡眠状态的最长时间,house keeper 的职责就是检查各个连接的状态,并判断是否需要销毁或者创建,这个的默认值是30秒。
house-keeping-test-sql: 如果发现了空闲的数据库连接.house keeper 将会用这个语句来测试.这个语句最好非常快的被执行.如果没有定义,测试过程将会被忽略。
maximum-active-time: 如果housekeeper 检测到某个线程的活动时间大于这个数值.它将会杀掉这个线程.所以确认一下你的服务器的带宽.然后定一个合适的值.默认是5分钟。经常有些人或许会遇到正在执行的程序忽然拒绝连接,莫明其妙的程序假死,这些都与这个参数的设置有关,我们大部分数据库操作都会在5分钟之内完成,可是偏偏有些可能5分钟还完成不了,而这个值如果按照默认值的话,连接池就会不管你到底有没有执行完,都会强行关闭数据库连接,所以这个值你可要小心设置哦:)
maximum-connection-count: 最大的数据库连接数.一般的大应用设置30就足够了。
maximum-connection-lifetime: 一个线程的最大寿命.
minimum-connection-count: 最小的数据库连接数,一般最好事先初始化一部分连接这样,对于初次连接数据库的应用效率比较高,推荐设置5-10
prototype-count: 连接池中可用的连接数量.如果当前的连接池中的连接少于这个数值.新的连接将被建立(假设没有超过最大可用数).例如.我们有3个活动连接2个可用连接,而我们的prototype-count是4,那么数据库连接池将试图建立另外2个连接.这和 minimum-connection-count不同. minimum-connection-count把活动的连接也计算在内.prototype-count 是spare connections 的数量.
trace: 如果为true,那么每个被执行的SQL语句将会在执行期被log记录(DEBUG LEVEL).你也可以注册一个ConnectionListener (参看ProxoolFacade)得到这些信息.

maximum-connection-lifetime:

The maximum amount of time that a connection exists for before it is killed (milliseconds). Default is 4 hours.

house-keeping-sleep-time:

How long the house keeping thread sleeps for (milliseconds). The house keeper is responsible for checking the state of all the connections and tests whether any need to be destroyed or created. Default is 30 seconds.

recently-started-threshold:

This helps us determine whether the pool status is up, down or overloaded. As long as at least one connection was started within this threshold (milliseconds) or there are some spare connections available then we assume the pool is up. Default is 60 seconds.

overload-without-refusal-lifetime:

This helps us determine the pool status. If we have refused a connection within this threshold (milliseconds) then we are overloaded. Default is 60 seconds.

maximum-active-time:

If the housekeeper comes across a thread that has been active for longer than this (in milliseconds) then it will kill it. So make sure you set this to a number bigger than your slowest expected response! Default is 5 minutes.

免责声明:文章转载自《proxool连接池的一些参数》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Oracle12c中配置实例参数和修改容器数据库(CDB)及可插拔数据库(PDB)每个程序员都应该了解的内存知识下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

数据连接池DruId的使用

1,下载druID.jar包 2,配置文件druid.properties配置相关信息 driverClassName : org.gjt.mm.mysql.Driverurl : jdbc:mysql://127.0.0.1:3306/e_testusername : rootpassword : admin#初始化物理连接数目#initialSize...

Spring Boot (三): ORM 框架 JPA 与连接池 Hikari

前面两篇文章我们介绍了如何快速创建一个 Spring Boot 工程《Spring Boot(一):快速开始》和在 Spring Boot 中如何使用模版引擎 Thymeleaf 渲染一个Web页面《Spring Boot (二):模版引擎 Thymeleaf 渲染 Web 页面》,本篇文章我们继续介绍在 Spring Boot 中如何使用数据库。 1....

mybatis深入之动态查询和连接池介绍

mybatis深入之动态查询和连接池介绍 一、mybatis条件查询 在mybatis前述案例中,我们的查询条件都是确定的。但在实际使用的时候,我们的查询条件有可能是动态变化的。例如,查询参数为一个user对象,要根据这个user对象进行查询,有可能要根据name属性进行查询,有可能是id属性进行查询,也有可能是根据id和name进行查询。这个时候我们就要...

Java 连接池的工作原理

什么是连接? 连接,是我们的编程语言与数据库交互的一种方式。我们经常会听到这么一句话“数据库连接很昂贵“。 有人接受这种说法,却不知道它的真正含义。因此,下面我将解释它究竟是什么。[如果你已经知道了,你可以跳到它的工作原理部分] 创建连接的代码片段: 1 String connUrl = "jdbc:mysql://your.database.dom...

springboot使用RestTemplate+httpclient连接池发送http消息

简介 RestTemplate是spring支持的一个请求http rest服务的模板对象,性质上有点像jdbcTemplate RestTemplate底层还是使用的httpclient(org.apache.http.client.HttpClient)发送请求的 HttpClient可以做连接池,而发送消息的工具类可以使用RestTemplate,...

SpringBoot专栏(四) -- SpringBoot+MyBatis集成Druid连接池

解决问题: SpringBoot2.0+MyBatis框架集成阿里Druid连接池? 本章基于SpringBoot专栏(三) -- SpingBoot集成MyBatis框架的代码。 1.在pom.xml文件中导入Jar包。 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xm...