On 21 Nov 2011, at 16:25, Martin O'Shea<app...@dsl.pipex.com>  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 [mailto:tere...@tmbsw.com]
 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 doing.

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to