Re: Tomcat can't connect to MySQL
- From: Mark Jeffcoat <jeffcoat@xxxxxxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 23:33:16 GMT
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
.
- Follow-Ups:
- Re: Tomcat can't connect to MySQL
- From: georgesbilodeau
- Re: Tomcat can't connect to MySQL
- References:
- Tomcat can't connect to MySQL
- From: georgesbilodeau
- Tomcat can't connect to MySQL
- Prev by Date: Tomcat can't connect to MySQL
- Next by Date: Simple Problem for 2nd year Comp Sci Class
- Previous by thread: Tomcat can't connect to MySQL
- Next by thread: Re: Tomcat can't connect to MySQL
- Index(es):
Relevant Pages
|