File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webcontainer 80 % threads were waiting for database getconnection

 
selva raja
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

In websphere i got a below exception in during the peak load. My application running on the spring MVC. I have defined datasource connection pool size is 50 and time out setting is 180 sec...

I have reviewed the native_stdout.log file, the Object.wait() is showing 299 thread and percentage of usages is 80%.




what could be the cause for the above errors?
Is it related to application or websphere server?

Thanks,
selva
 
Anant Rao
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you verify if the database is up and running. You would get this error when the database is down.

Thanks
Anant
 
selva raja
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...YES.. database is working fine. The above errors occurs only during peak load.
 
selva raja
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PFA of connection pool setting for your ref.

Thanks,
selva
connectionpool.JPG
[Thumbnail for connectionpool.JPG]
 
Brian Hennessy
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Selva
I would look at a couple of things.
Try identify if you have SQL calls taking longer than your connection wait timeout. If you have 50 connections all executing SQL and each piece of SQL takes 3 minutes to execute you could get this problem.

If its not the database then it could be a call to an integration point thats wrapped in the same transactional call as the db call.
For example

void callQuote() {
start transaction
call really_fast_sql
call http_service
end transaction
}

Note: start and end transaction probably handled by Spring AOP

if the call to call http_service blocks waiting on a response , the connection that is used to make the SQL call will not be released to the connection pool until the whole method ends.
Maybe the external system you call experiences problems at your peak load and its not in the database.

You fix this by removing the remote call from the transaction


Perform a thread dump and see whats executing and what else is waiting[and look at code].
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic