zoukankan      html  css  js  c++  java
  • proxool连接池的一些参数

    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.

  • 相关阅读:
    retain assign copy (unsigned long)
    myeclipse未设置断点,但不断跳出debug
    SOAP tomcat7.0 HelloWorld
    JAVA第二天数据类型和循环
    java中产生随机数的几种方法
    java的第一个程序 Hello World
    java中产生随机数的几种方法
    用加减来简单的看策略类
    用加减来简单的看策略类
    奇数阶幻方
  • 原文地址:https://www.cnblogs.com/pony/p/1266633.html
Copyright © 2011-2022 走看看