tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gordon Luk" <gor...@gforce.ods.org>
Subject RE: Connection Pool setup.
Date Fri, 26 Mar 2004 04:18:15 GMT
Here my setting...

My problem is ... Connection pool look like don't open 10 connection at
start-up, and when my servlet run for a while... Let it open up more
connections(over 30) and then wait... (after a night .. :-D)... When I
check database server, it still open more connections, I expect min. for
10 only.

My setup anything got wrong?  Thx.
------------------->8------------------------
<?xml version='1.0' encoding='utf-8'?>
...
    <ResourceParams name="jdbc/myjdniname">
        <parameter>
            <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
         -->
        <parameter>
            <name>maxActive</name>
            <value>100</value>
        </parameter>
        <!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.
         -->
        <parameter>
            <name>maxIdle</name>
            <value>10</value>
        </parameter>
        <parameter>
            <name>minIdle</name>
            <value>10</value>
        </parameter>
        <!-- Maximum time to wait for a dB connection to become
available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely.
         -->
        <parameter>
            <name>maxWait</name>
            <value>10000</value>
        </parameter>
        <parameter>
            <name>username</name>
            <value>myuserid</value>
        </parameter>
        <parameter>
            <name>password</name>
            <value>mypassword</value>
        </parameter>
        <!-- Class name for mm.mysql JDBC driver -->
        <parameter>
            <name>driverClassName</name>
            <value>net.sourceforge.jtds.jdbc.Driver</value>
        </parameter>
        <parameter>
            <name>url</name>
            <value> 
 
jdbc:jtds:sqlserver://myserver/mydatabase;TDS=4.2;charset=big5</value>
        </parameter>
        <parameter>
            <name>validationQuery</name>
            <value>select count(*) from tablename</value>
        </parameter>
        <parameter>
            <name>testOnBorrow</name>
            <value>true</value>
        </parameter>
        <parameter>
            <name>testWhileIdle</name>
            <value>true</value>
        </parameter>
        <parameter>
            <name>timeBetweenEvictionRunsMillis</name>
            <value>5000</value>
        </parameter>
        <parameter>
            <name>minEvictableIdleTimeMillis</name>
            <value>10000</value>
        </parameter>
    </ResourceParams>
....
</Context>
------------------->8------------------------

Regards,

Gordon Luk



-----Original Message-----
From: D'Alessandro, Arthur [mailto:Arthur.Dalessandro@cbetech.com] 
Sent: Thursday, March 25, 2004 7:03 PM
To: Tomcat Users List; Tomcat Users List
Subject: RE: Connection Pool setup.


May help if you post your resource snipplet (replacing any host
/user/passwd info)

 -----Original Message-----
From: 	Gordon Luk [mailto:gordon@gforce.ods.org]
Sent:	Thu Mar 25 05:30:56 2004
To:	Tomcat Users List
Subject:	Connection Pool setup.

Hi All,

    May be I missing understand the DBCP configuration. Anyone could
help ? I want my connection pool are Max 100 connection, 10 conn. At
start-up, max idle 10, when idle for 10 min then kill it. Something like
that.

   Thanks.


Regards,

Gordon Luk



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.639 / Virus Database: 408 - Release Date: 3/22/2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.639 / Virus Database: 408 - Release Date: 3/22/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.639 / Virus Database: 408 - Release Date: 3/22/2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message