23
votes

I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server.

Can someone share their experiences with either of them?

4

4 Answers

24
votes

They are not really comparable.

Apache Tomcat is not a J2EE Server. It's merely a Servlet Container for Web-Applications. Nothing more. If you need J2EE API implementations, you have to take those from elsewhere. For example by using the Apache Geronimo Server which uses Tomcat as its container, or by taking the JAR files from Glassfish.

Glassfish is a complete Java Application Server with implementation for APIs like JPA, EJBs and more. Glassfish contains a Servlet Engine initially used by Tomcat, but they improved it (don't know what exactly). More recent glassfish servers use another container using grizzly which uses the NIO API for input/output and scales quite well. As far as i know, the Glassfish Servlet Engine is more performant. Here i've found a nice benchmark (it's a bit old though):

http://weblogs.java.net/blog/sdo/archive/2007/05/how_to_test_con.html

11
votes

Here's quite an old comparison. As such, the capabilities of each server have doubtless improved.

Edit: Here is a current comparison.

Both are more than stable enough for production use though. It's really going to come down to features.

3
votes

Big question is: why? What do you think you need that Glassfish will provide you over Tomcat or Jetty? Management utilities perhaps?

Most things you want beyond basic servlet container are easily pluggable.

So while Glassfish is fine as is, there is no point in moving "just because". Most production services I have built are on plain old servlet containers, using none of implementation-specific features.

1
votes

This may be a little dated and maybe even a little biased, but it's from Oracle. You can skip down to the section for comparing Glass Fish to Tom Cat

http://java.sun.com/developer/technicalArticles/glassfish/GFandMySQL_Part1.html