Re: Tomcat can't connect to MySQL



georgesbilodeau@xxxxxxxxx writes:


I use a custom-made database connection pool that doesn't have any
serious problems. If a connection in the pool leaks, which happens very
rarely, the app is able to recover, and if all connections have leaked,
the app will open up new connections to the DB (the app has never
actually leaked all connections in production, just in testing).


I believe without evidence that the reason you mentioned this
is that some part of your mind that you're not quite yet conscious
of believes that the problem is somewhere in here.


The app will be running for fine for a day or two, without any hitch in
response time, then all of a sudden the site will hang inexplicably.
There are no errors to speak of in the catalina log when it hangs like
this. MySQL is still running because other apps can hit the same
database without a problem. Tomcat & Apache are both still running
because I can access pages on the site that don't require a DB
connection.


I'd want to focus first on reproducing the symptoms in a
controlled environment. The simplest way that might possibly
work is to use a tool like ab ("Apache bench", probably lurking
somewhere in your Apache distribution) to hit a page that requires
a db access many many times (pointing at a test machine, of course),
and see if it locks up after a fews days worth of hits.

That would be excellent. Do that, and you've got something
to test hypotheses with.

(This sort of thing happened to me once -- I ended up figuring
out that running two instances of ab with slightly different
timings would get it to freeze up almost instantly, which just
screams "Race Condition". Once I knew what I was looking for,
forehead slapping quickly followed.)

(Without being able to reproduce the bug, I could have found
and fixed the race condition, but not had any idea whether or
not I'd fixed the problem that was actually causing the observed
freeze. It was worth the effort.)


--
Mark Jeffcoat
Austin, TX
.



Relevant Pages

  • Re: ADO Connections - close them or keep them open?
    ... N-Tier Applications. ... VB - global to all the forms that the user might call up in the app - I ... you likely will run out of connections quickly and requests will start ... Yes Access connectivity to a SQL Server DB can be downright crippling. ...
    (microsoft.public.sqlserver.server)
  • Re: .net IDE Shuts Down during a build
    ... I did not get to try your solution coz .. ... Shut down the IDE ... Then envoke the web app from the browser, then open the IDE, then ... > which you can re-enable the network connections and the IDE seems to be OK ...
    (microsoft.public.vsnet.ide)
  • Re: Created on Access 2003, but.......................
    ... The database is read by the users of it via ASP web pages. ... host allows for both types of connections. ... The app just has to make sure that it doesn't bring over any extraneous data, as any client-server app should do. ...
    (comp.databases.ms-access)
  • Re: High CPU usage
    ... There were about 4 app servers connecting to database in 9i. ... more connections. ... servers which is around 160 but still we are facing high cpu usage. ...
    (comp.databases.oracle.server)
  • Re: [PHP] problem with url_fopen on free hosting environment
    ... I tried to limit connections with iptables, but it did not work out. ... I know it just limits new connections, and I thought this would work out, but it didn't. ... There's also mod_bandwidth for Apache, not included in the aforementioned topic. ... Confidentiality: ...
    (php.general)