Skip to main content

Performance issue

3 replies [Last post]
emsti
Offline
Joined: 2006-10-31

What could cause the JVM instance to go down in this case?

- The servlet invocations keeps rising,
- certain methods that access a common database are stalling and the calls to the methods are increasing.
- eventually the JVM cannot take any more requests, and the number of jdbc connections is no longer varying.
- I know the DB is up.
I suspect the connectivity to the DB breaks down, but not quite sure what to look for to verify if that is indeed the case. Does this sound reasonabl ot if you have any other suggestions?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linuxhippy
Offline
Joined: 2004-01-07

use a profiler (e.g. netbeans profiler) which can show you the stack-traces of your threads - and where they are waiting.

I had a compareable problem with a thread-safe-problem in my jdbc-pool. It leaked some returned connections and after some time of high load it died :-/

lg Clemens

emsti
Offline
Joined: 2006-10-31

Hi Ig,

my bad, I should have mentioned that I did have the stack traces for the threads when I took a thread dump.

In the thread dumps I noticed that a lot of the threads were stuck in the db.borrowConnection method and all of these were in the Running State.

Which is why it seemed like it was a JVM-DB connectivity issue. Do you think a dbping -d to the DB would help in verifying if this is the problem?

At this point I have a couple of questions for you
1. In your stack traces were you also seeing a whole of threads in the Running state?
2. I have seen this issue multiple times now. What was your conclusion or resolution to this problem, as in was a JVM-DB connectivity thing or were you able to pin it down to something else?
3. A follow up to the 1st one, is having so many threads in the Running state normal behavior?

Thanks.

linuxhippy
Offline
Joined: 2004-01-07

I can just guess but as far as I can imaginge your connection-pooling is somehow broken:

- Do you return all borrowed connections under all circumstances (exceptions, ...) (best done in finally)
- Did you write the pool yourself, if yes make sure its thread-safe.
- Could it be somehow that your code is not thread-safe. Try to over-synchronize (maybe only one thread at all may be in your code) - if it works you know you'll have to look at threading.

lg Clemens