Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

JBoss, Geronimo, or Tomcat?

Three open source Java application servers compared

  • Print
  • Feedback

Page 4 of 4

JBoss 4.2 also has a nice-looking management console (see Figure 2), but it doesn't provide near the feature set of Geronimo. It primarily gives you JBoss status and monitoring information, and it lacks deployment features. To deploy an application you simply copy it to the default /deploy directory, after which it is automatically and quickly deployed. Optionally, you can set your own custom deployment directory by specifying it in the jboss-service.xml configuration file.

JBoss Web console

Figure 2. JBoss Web console

Tomcat 6 is quick and slim, true to form for a lightweight application server. It provides a nice Web console with the basic features that you need (see Figure 3). You can start/stop and deploy/undeploy WAR applications from the Web-based Tomcat manager. It also provides most of the status and monitoring information you would want. It has a good basic authentication system for the Web console too: you simply specify users/passwords in an XML file within one of the Tomcat server directories.

Tomcat Web console

Figure 3. Tomcat Web console

Performance benchmarks

Along with reliability, performance is perhaps the most important feature for an application server. To benchmarks the servers, I did a simple test with a JSP page and a compiled servlet to see how many user application sessions the servers would handle and how fast they would connect users. Real-world Java applications are large. My test JSP and servlet were small, serving only to test the basic scalability, reliability, and speed of these servers.

Using my dual-core 64-bit CPU server with 4 GB of RAM, I was able to get all three Java servers to run up to 1.2 million concurrent sessions. That doesn't mean simultaneous connections, but it means maintaining concurrent unique user sessions that browser clients connect to. I could surely have gotten more then 1.2 million if I had more memory.

Figures 4 and 5 show the benchmark results.

Benchmark 1: Starting massive quantities of JSP sessions

Figure 4. Starting massive quantities of JSP sessions

Massive hits on a servlet that checks the sessions created in Benchmarks 1

Figure 5. Massive hits on a servlet checking the sessions

The code used for gathering these benchmarks was a few hundred lines long. For accuracy, I used the same configuration for each server test. With real-world Java EE applications, each session would maintain much more data then my test, so you wouldn't get the massive numbers I did unless you ran a mid-range server with eight processors and lots and lots of RAM.

JBoss 4.2 did not do quite as well as Geronimo 2 because Geronimo is newer and uses more up-to-date internals. Tomcat 6 did the best of all because it is a lightweight server specifically designed for JSP/servlet services, which is what I benchmarked. Tomcat takes 3 seconds to start up compared to about 20 seconds for JBoss or Geronimo.

If these servers run out of memory, they are inclined to crash. I once had a Java: null pointer exception with JBoss 4.2 on trying to shut it down, even though it hadn't run out of memory. Geronimo and Tomcat both seem to stall badly when they run out of memory, and I had difficulty just shutting them down at that point.

In conclusion

I have installed and deployed Java applications on both commercial Java application servers (such as Sun's Java Application Server and BEA WebLogic) and on open source alternatives. In my experience commercial application servers have more bugs than the open source servers compared in this article, and they are more difficult to install. Deployment can also be an issue -- at least with the recent version of Sun's Java Application Server.

Bottom line: JBoss, Geronimo, and Tomcat are reliable, fast, and definitely able to handle the traffic on large-scale enterprise applications. Furthermore, many of the high-demand Java server technologies presented in the features comparison originate from the open source world, not the commercial one.

In this article I've compared three popular open source JEE application servers based on features, deployment, and performance. The features comparison should help you determine which of these open source options best suits the needs of your application environment, and the performance benchmarks should help you round out your consideration.

About the author

Jonathan Campbell holds more than 15 IT certifications and works as a project manager. He has been developing software for various flavors of Unix since the late 1980s and for Windows since the mid 1990s. He also has expertise in network engineering and integration of Unix, Linux, and Windows platforms. He has worked for various corporations and the United States government.
  • Print
  • Feedback

Resources

Downloads:

More about Java EE application servers: