You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "karthik.nar" <ka...@gmail.com> on 2006/05/09 05:32:53 UTC
MySQL Connection Pooling and Journaling
Hello,
Here is my datasource setup for MySQL
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
<property name="username" value="activemq"/>
<property name="password" value="activemq"/>
<property name="poolPreparedStatements" value="true"/>
<property name="initialSize" value="30"/>
<property name="maxActive" value="60"/>
<property name="maxIdle" value="300"/>
<property name="maxWait" value="-1"/>
<property name="removeAbandoned" value="true"/>
<property name="logAbandoned" value="false"/>
<property name="removeAbandonedTimeout" value="5"/>
</bean>
At the MySQL prompt i use
show processlist;
to see how many connections are active.
I run a producer program with 30 threads, enqueing 10 messages each.
Now when I use the configuration:
<persistenceAdapter>
<journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data"
dataSource="#mysql-ds"/>
</persistenceAdapter>
i see no issues regarding connections growing.
however when I use this configuration:
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#mysql-ds"/>
</persistenceAdapter>
i find that connections to the DB shoot up and after a few seconds I get the
"Too Many Connections" Error from MySQL. At the command prompt I see 100
connections.
Since maxActive is set to 60, does this mean that ActiveMQ bypasses the
connection pool for some other reasons, when journaling is turned off?
--
View this message in context: http://www.nabble.com/MySQL-Connection-Pooling-and-Journaling-t1581839.html#a4293113
Sent from the ActiveMQ - User forum at Nabble.com.