12 Replies Latest reply on Oct 10, 2010 2:22 PM by Jean-Frederic Clere

    Tomcat vs Jetty

    Leonid Shamis Newbie


      I currently use JBoss/Tomcat bundle but I'm wondering what is different between it and JBoss/Jetty bundle.
      It will be very interesting to know pros and cons of using Tomcat vs Jetty (in a bundled form): JSP/Servlets/HTTP specifications compatibility, performance, security, maintenance, integration with Jboss, integration with Apache, other features.

      Thank you.

        • 1. Re: Tomcat vs Jetty
          Jules Gosnell Novice



          Jetty3 and TomCat3

          - both implement JSDK 2.2 (and comply)
          - both implement JSP via Jasper (JSP Engine)
          - both have JAAS integration working with JBoss
          - both integrate with Apache

          TomCat is the reference Servlet container - Jetty isn't - so you will find more TomCat users out there.

          Jetty is also a fully fledged HTTP1.1 server, TomCat has a simple HTTP implementation.

          JBoss.org used to run on JBoss/Tomcat, it now runs on JBoss/Jetty. This change was made because the powers that be perceived Jetty to be faster and scale better than TomCat.

          As far as deploying your EARs on JBoss, both integrations should be entirely compatible. If you have something that deploys on JBoss/Tomcat and doesn't on JBoss/Jetty, let me know and I will fix it.

          I suspect that JBoss/Jetty users, in the main, are not using Apache, but are using Jetty HTTP for both static and dynamic content. This means that they have only one process to worry about and requests are being answered immediately rather than being passed from Apache onto TomCat. This makes life simpler.

          If you need to stick with Apache for e.g. really fast Perl CGI (Jetty has a CGI Servlet, but no equivalent to mod_perl) then there is still no reason not to use Jetty, but you will not reap the benefits of a much simpler set up.

          Download it, try it and report back to this forum with your findings. This question comes up all the time but it is rare for anyone other than me to actually report real in-the-field experiences here.


          • 2. Re: Tomcat vs Jetty
            Randy Kemp Newbie

            I prefer Jetty over Tomcat 3.X, but I wonder how my preferences will go with 4.x? Jules mentioned that "Jetty is also a fully fledged HTTP1.1 server, TomCat has a simple HTTP implementation." But from reading the doc of 4.x, I get the feeling the HTTP is a full implementation. And Tomcat 4.0.B7 seems much faster then Tomcam 3.x.

            • 3. Re: Tomcat vs Jetty
              Jules Gosnell Novice

              So, Randy,

              Given that you've used both Jetty3 AND TomCat4, can you give us any direct comparisons - are they pretty much the same speed, or is there a noticeable difference - if so, who needs to get their optimisation cap on ?


              Try out Jetty 3.1.RC8 (I've just put the latest bundle up on SourceForge - the binary.jsp page should update soon). Greg has done some speeding up work on it and I reckon it flies. Marc has upgraded jboss.org to it and I reckon it feels much faster today - maybe it's just my connection...

              • 4. Re: Tomcat vs Jetty
                Randy Kemp Newbie

                As far as speed goes, Jetty and Tomcat 4 appear to be neck and neck. I am not saying Tomcat 4 is necessarily better then Jetty. What I am saying is that Tomcat 4 is better then Tomcat 3X, and it appears to have a similar HTTP component found in Jetty 3. I suppose the only real test of popularity is to wait until Tomcat 4 is out of Beta, and bundled with Jboss. Then we can see how many downloads of the Tomcat/Jboss bundle occur compared to the Jetty/Jboss bundle.

                • 5. Re: Tomcat vs Jetty
                  yuval rimar Newbie

                  Does jetty really integrate with Apache?
                  I've found no documentation stating this.


                  • 6. Re: Tomcat vs Jetty
                    Jules Gosnell Novice

                    Look around on jetty.mortbay.org or post jetty-discuss@yahoogroups.com



                    Since this thread started, TC and Jetty have both moved to 4.x versions - so it is now a little out of date.

                    • 7. Re: Tomcat vs Jetty
                      Josh Sents Newbie

                      We had switched to Tomcat 4.0.1 to get to the higher spec when Jetty 4.0 was not out yet. We have now switched back to Jetty 4.0 because it is faster. For example a page that takes 5 to 6 seconds on Tomcat comes up in 2 to 3 in Jetty. We also find Jetty easier to configure.

                      • 8. Re: Tomcat vs Jetty
                        Jules Gosnell Novice

                        Thanks for the positive feedback.

                        It's always welcome.


                        • 9. Re: Tomcat vs Jetty
                          Sean O'Donnell Newbie

                          One major difference is that jboss is only directly developing httpSession clustering support for jetty, and not for tomcat, they will probably move on to tomcat when jetty support is done, but if you want to be able to cluster your web app effectively any time soon jetty will be the way to go.

                          • 10. Re: Tomcat vs Jetty
                            Yen-Fen Hsu Newbie

                            Is there any performance comparison bewteen Tomcat5.5 vs. Jetty6 in JBoss4.0.4 in terms of AJAX applications support?

                            • 11. Re: Tomcat vs Jetty
                              Jimmy Chtop Newbie

                              Here have a link about Tomcat and Jetty performance comparison, you may take a look


                              • 12. Re: Tomcat vs Jetty
                                Jean-Frederic Clere Master

                                As jboss uses jbossweb (an optimized fork of Tomcat) that is not very acurate