Tomcat works great, even for "non enterprisey" solutions. I'm on my phone but will provide some excellent reasons when i get to a PC later. its very stable if you configure it correctly and works quite smoothly "out of the box".
UPDATE:
I've been running a Tomcat server with about 25 J2EE web applications of varying complexity for a couple years now. The server is a SPARC Dual Core 2.0GHz, 2GB RAM machine running Solaris. The previous server administrator (who is no longer with our company) did not do anything to re-configure the default tomcat instance. As such, we had some pretty spotty performance with some of our really I/O intensive applications due to memory constraints. Tomcat's default (I believe) allocates only 64MB of memory, which is just asking for OutOfMemory exceptions (and we experienced them for a while). Our department just trudged on though, and accepted restarting the server every day as a "procedure". Ugh.
When he left I was tasked with configuring our tomcat server and spent some time investigating how to properly configure it for our environment. I found that I only needed to add a couple of new arguments to the catalina.sh startup script in order to turn Tomcat into a very stable, very fast environment. The following line exists in catalina.sh (around line 112 on a default install of Tomcat 6.0.18):
CATALINA_OPTS=" $CATALINA_OPTS"
I changed the line to read as follows:
CATALINA_OPTS="-server $CATALINA_OPTS -Xms512m -Xmx2048m -XX:MaxPermSize=512m -Dcom.sun.management.jmxremote"
Explanation:
- -server : This sets the container to act as a dedicated server.
- -Xms512m: Sets the inital heap size to 512MB (1/4 the amount of memory on the server). You can play around this value, since the operation to change the heap size has a performance penalty, so set it to a value that will be in the range of your normal usage.
- -Xmx2048: Sets the maximum heap size to 2GB (the amount of memory on the server). This should be maxed out if your machine is a dedicated server to get the most out of your environment, I've found.
- -XX:MaxPermSize=512m: Maximum permanent generation. I set this equal to the initial heap size.
- -Dcom.sun.management.jmxremote: I add this to enable this jar file by applications on the server. I use it so I can run the Lambda Probe monitoring application, which I really like for analytics on my server.
With this additional line, our server went from being up and down 1 to 2 times daily during a busy day to now being stably online without a restart for the past 20 days since I implemented this configuration.