tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <>
Subject Re: Connection pooling issue with MySQLNonTransientConnectionException and Java webapp
Date Tue, 22 Nov 2011 07:05:53 GMT

> On 21 Nov 2011, at 16:25, Martin O'Shea<>  wrote:
>>  Thanks Terence.
>>  Yes, I have been. Increasing the number of connections in MySQL, the
>>  max_connections parameter, seems to have helped somewhat.
> If you are leaking connections it will just delay the problem, even
> make it worse.
> Connect VisualVM to Tomcat and monitor the connection pool, (assuming
> you have configured the pool as a Resource).
> If it keeps increasing in size, outgrowing the Connector threads, you
> have a leak.
> p
>>  Is there an optimum number of connections that the 'equivalent' Tomcat
>>  maxActive should have?
>>  -----Original Message-----
>>  From: Terence M. Bandoian []
>>  Sent: 21 Nov 2011 16 11
>>  To: Tomcat Users List
>>  Subject: Re: Connection pooling issue with
>>  MySQLNonTransientConnectionException and Java webapp
>>  On 1:59 PM, Martin O'Shea wrote:
>>>  Caused by:
>>>  com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
>>>  Data source rejected establishment of connection,  message from
>>>  server: "Too many connections"
>>  I'd check into this.
>>  -Terence Bandoian

Hi, Martin-

I agree with Pid that you should ensure you're not leaking connections.  
In addition to what he suggested, you can check the MySQL status 
variables using the 'show global status' statement from the MySQL 
command-line shell.  Interesting variables might include Connections, 
Max_used_connections and possibly Threads_connected.

The error message was generated by the MySQL server so, once you're sure 
the connections are handled correctly by your software, I would think 
max_connections is the right setting to adjust, as you've already been 

-Terence Bandoian

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message