• Post Reply Bookmark Topic Watch Topic
  • New Topic

Isolated Servlet Performance Degredation  RSS feed

 
Reginald Blank
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a tomcat server with 2 (spring & hibernate/postgres) web applications.
One of the web applications has a few hundred sessions associated with it (they last 10 minutes) and has slowed down to the point where other user can no longer log in.
The other web application, with hardly any users, is fine and runs quickly.
In order to improve performance I need to understand what is happening but this isolated per servlet slow down is difficult to understand.
If it was something like database performance or max (HTTP) connectoins I would expect both servlets to be affected the same way, not in isolation.
Is there any per servlet configurations that are likely to be maxed out?
The only one I could think of was the maxActive property in apache's BasicDataSource which was set to the default of 8. This is per web app.
I increased it to 32 and nothing seemed to improve.

Could it be that the change hasn't taken?
I shutdown tomcat.
Renamed the war file to end with war.old.
Went into WEB-INF and edited the database.xml file directly and restarted tomcat.
Tomcat has been restarted several times since.

Are there any other per servlet limits I should look at?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would certainly be using the tomcat Management app to watch such things as memory use, total request Threads and how long they had been running.

has slowed down to the point where other user can no longer log in.


If that means that a new user could not even connect to the server then it sure sounds like you have used up all the request Threads that Tomcat allocates.

The time this happened to me, the Management app revealed that most request threads had been running on the same request for extended periods - even hours. Turned out I had not correctly handled what happened when a resource was not available.

Bill
 
Reginald Blank
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But a new user can login - just on the other web app - which surely shares the same connector and the same connection threads. If it was the max thread count being exceeded I would expect all web apps to prevent users from logging in? Or have I misunderstood the configuration option?

Not to mention that setting the limit to 1024 or even 2048 still doesn't prevent the problem.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be conflating servlets with webapps.

A webapp can (and often does) contain many servlets.

Is the entire app in a bottleneck or have you localized it to one specific servlet?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just going to repeat my advice. Use the management app to look at the state of the request Threads (especially how long they have been running) and memory use.

 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd second William's advise. Focus on the problem first. Find exactly what is causing this one servlet to slow down. RIght now, the observation that other servlet works fine is kind of a red herring. It might be important later on, so file it in the interesting-things-to-ponder-about folder. Once you figure out what causes the slow down in the problematic servlet, you might figure out what causes the other servlet to work when this one doesn't. However, right now, this piece of information is not leading you to a solution. Treat it as noise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!