This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connections to Tomcat

 
Thomas Greene
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have around 50 users connected to the application which is deployed on tomcat 6 (windows 2008).

In catalina.log, I can see the following -

org.apache.tomcat.util.threads.ThreadPool logFull
SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads (200) or check the servlet status


Can someone please let me know the following -

1. How could it be creating 200 threads when there are just 50 users. Could this be something related to code?

2. where can we increase the number maxthreads?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you display a web page, it commonly is not fetched via a single request. There is the master request plus many cascading sub-requests. These sub-requests fetch script files, CSS files, images, and so forth. So a 5-to-1 or higher request cascade would be quite common. Now augment that when the server begins to mis-behave and frustrated users start clicking buttons and links, thereby adding even more requests to the mix.

Before you expand the thread pool, you need to find out why the threads are not being released, because apparently there are a lot of stuck requests out there. That would seem to indicate a critical application bug, possibly due to unexpected race conditions resulting in either CPU loops (that's easy enough to detect) or deadlocks (which is trickier). Or sometimes a mix of both.

Since it looks like possibly not only is the main page request hanging up, but (if numbers mean anything), the minor stuff like page resources and image fetches as well, the first place I'd check would be to see if there are any filters in the request chain, since filters are something that almost everything gets passed through.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the management app to see what those Threads are doing.

When this happened to me, I found a bunch of Threads that had been running for hours because they were waiting for a resource that I had not started.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic