Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Tomcat web application limit

 
Harry Jones
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Harry Jones
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much. I appreciate everyone's help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic