• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Webcontainer 80 % threads were waiting for database getconnection

 
Ranch Hand
Posts: 69
  • 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
 
Ranch Hand
Posts: 126
  • 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
  • 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
  • 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]
 
Ranch Hand
Posts: 57
  • 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].
 
Don't MAKE me come back there with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!