GeeCON Prague 2014*
The moose likes Tomcat and the fly likes Java Tomcat web application limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Java Tomcat web application limit" Watch "Java Tomcat web application limit" New topic
Author

Java Tomcat web application limit

Harry Jones
Greenhorn

Joined: Mar 19, 2010
Posts: 20
I have a small production web application on a virtual dedicated server with CentOS 5.4, java 1.6.0, apache-tomcat-6.0.18, and mysql 5.0.77.
After very heavy traffic, I could no longer access my website. I got a blank screen. The catalina log said only that contextDestroyed() of the ContextListener was called.
I redeployed the application and everything seems fine. Did I hit a limit of some kind in Tomcat or Java that caused the application to crash?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
You need more information, use the Management App to watch the various parameters, such as busy Threads.

Tomcat will become unresponsive it all request Threads are hung somewhere.

Bill
Harry Jones
Greenhorn

Joined: Mar 19, 2010
Posts: 20
The difficulty with monitoring the application is that the crash was an isolated incident. The application has been up for a couple years without this kind of problem, although I have redeployed the application from time-to-time for other reasons.
I do create a thread pool for sending out emails, but there are only 3 threads in it, and there were only 2 users on line when the application crashed. But the traffic that day had been heavy.
Thank you for your feedback. I will look into the app. Could the problem be related to memory or garbage collection up?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

If you're lucky, a cosmic ray came streaking through one of the RAM chips, flipped a bit and scrambled something that was cleaned up on restart.

If not, it will probably happen again, and experience says that even if the bug was 15 years old, once it pops up, it manifests itself fairly frequently, for better or worse.

In cases where the JVM is still operational but Tomcat is delirious, try taking a snapshot dump for offline post-mortem analysis. It might be able to give some clues.


Customer surveys are for companies who didn't pay proper attention to begin with.
Harry Jones
Greenhorn

Joined: Mar 19, 2010
Posts: 20
And it will probably happen again at the worst possible time, as it did the first time. What is a snapshot dump? Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

Murphy's Law. Besides, there's nothing like running under stress to find those leaky bits of memory, files, network sockets and other resources.

The exact method of getting a heap dump will vary depending on whose JVM you are running. IBM, for example, has its own tools. However, for the Original Sun JVM, this is a good starting point:

http://docs.oracle.com/cd/E19798-01/821-1752/beafo/index.html

I had to dig harder to find it than I should have, though.
Harry Jones
Greenhorn

Joined: Mar 19, 2010
Posts: 20
Thanks very much. I appreciate everyone's help.
 
GeeCON Prague 2014
 
subject: Java Tomcat web application limit