Jetty vs tomcat:a Comparative analysis

Source: Internet
Author: User
Tags netcraft sybase glassfish jboss tomcat server apache camel

Jetty vs Tomcat: Comparative analysis

Original: https://www.webtide.com/choose/jetty.jsp

Color annotation reference to: Http://www.slideshare.net/noriaki/jetty-vs-tomcat

Translator Note: The 08 article, the process of Tomcat and jetty have more development, this article only to do historical reference, does not mean that the contrast between the two is still so.


1. Introduce

Jetty and Tomcat are often referred to as direct rivals. This article will make a brief comparative analysis of the two open source servlet containers from technical and non technical two aspects. 2. Technical comparison 2.1. Architecture (architecture)

From a shallow surface, tomcat and jetty are quite similar: they are also Java application servers that provide the Servlet 2.5 specification, and optional additional large JEE features.

However, careful observation of the architecture of the two servers is significant, and they historically have different concerns:

Tomcat is the primary application server (first and foremost an application server). Its default form of existence is as an application software that is arranged in the operating system, where Web applications can be installed. Tomcat can also be stripped as embedded or built on a complete JEE server, but these two approaches are difficult to implement. Jetty is the primary set of software components that provide HTTP and servlet services (first andforemost a set of software components, HTTP and servlet service). Jetty can be invoked and installed in the operating system as a stand-alone application server, or it can be simply embedded in an application or framework, as an HTTP component, as a simple servlet engine (the plain servlet engine), As a feature-rich servlet engine (a feature rich servletengine) or as part of a complete JEE environment.

Flexible component-based architectures Enable jetty to deploy flexibly and integrate into various types of scenarios:

L from mobile phones to large clusters of heavyweight servers (iron servers)

• In software frameworks and tools: OSGi Equinox, OSGi Felix, Spring, Plexus, Cocoon, Tapestry, Maven,continuum, Fisheye, Grails, JRuby, Xbean, Wait a minute.

L in JEE Application server: Geronimo, Jboss,sybase EAServer, JOnAS and Glassfish

L embedded in applications, products and services from IBM, HP, Cisco Cisco,bea, Yahoo and Eclipse. (Refer to http://docs.codehaus.org/display/JETTY/Jetty+Powered)

L as the basis for enhanced services such as SIP (www.cipango.org), Ajax JMS (www.activemq.org), Asynchronous SOA (asynchronous SOA) services (Apache Camel)

L as the basis for enhanced services such a SIP (www.cipango.org), Ajax JMS (www.activemq.org), asynchronous SOA Services (Apache Camel)

As the servlet specification continues to evolve and add additional features (such as annotations [annotations], Automated Web Services [automatic Web service], etc.), the overhead of the standard servlet server is increasing. Although Jetty will continue to support standard service forms (standardincarnation), its modular approach can be deployed in a targeted manner, allowing it to use just the right services, without adding additional complex, inefficient, or security-critical features that are not needed. 2.2. Performance

Both jetty and Tomcat provide good performance for per-second request processing, and there are significant differences between the factors that will become bottlenecks for any important web application.

It is difficult to provide a general benchmark for evaluation, the description of the Web load is greatly affected by the actual application, and we have no alternative to benchmarking for a particular application (benchmarks are difficult toprovide and web load Profiles are greatly influenced by the actual applicationand are no there for substitute specific. )。 However, we can do some general observations:

• Tomcat tends to perform slightly better in the case of maintaining a very small number of busy connections (few very busy connections). It has a weak advantage over request latency, especially when a large number of request/response messages are transmitted over a small number of connections that do not have a significant amount of idle time.

L The jetty tends to have better scalability when maintaining a large number of connections with significant idle time, which is consistent with the actual scene of most sites. Jetty's small memory footprint (small memory footprint) and the pre-NIO network Interface object (Advance Nio[networkinterface object) are used so that the memory available to each unit can be serviced by a large number of users. Also, smaller memory footprint means that fewer memory and CPU caches are used by the Serlvet container, so more caches can be used to accelerate the execution of important (non-trivial) applications.

L because jetty can use a pre-memory mapped file buffer combined with NIO to assemble writes to write operations and instruct the operating system to transfer the contents of these files at the maximum DMA speed, without having to go through user memory or the JVM, jetty is still in static content (static Content) Service has some better performance. 2.3. Characteristics

Both jetty and Tomcat implement the core standard content of the SERLVET2.5 specification, which provides the features required for a range of enterprise applications, such as JNDI,JTA,JMS, mail services, and so on. Tomcat has a simple solution to complete jee such as migrating to JBoss and Geronimo, while Jetty has a similar simple migration scenario, with more supporting environments, such as Geronimo, JBoss, JOnAS, Sybase EAServer and, And to some extent also support Glassfish

In the last 18 months, there has been an increase in the focus on web2.0 features, especially Ajax push and comet. From the Serlvet model, Jetty is already a leader in supporting web2.0 use cases, and the site has formalized JSR315 access in a proposal to jetty the development of serlvet3.0 specifications. The proposal is likely to be accepted as a standard solution for providing the asynchronous servlet required for web2.0. In contrast, Tomcat projects are slower to accept web2.0 use cases, but now it provides an asynchronous ioapi to meet their needs. However, this approach does not come from the servlet model, so it is not possible to use standard frameworks (JSP, Struts, etc.) and technology.   3. Non-technical comparison 3.1. Market occupancy Rate

Choosing a market leader is often used as an important selection criterion. While market share is often a sign of technical strength, many non technical or historical reasons may also affect the standard of choice-market share-especially in markets severely affected by standardization.

According to the Netcraft Server survey, the market share of Tomcat, which has dominated market shares, is declining, while Jetty's market share has steadily grown in the last 18 months, and its current share has reached 80% of Tomcat's market share.


Netcraft (http://www.netcraft.com) reports that the survey is only part of the measurement of the installation, because many servers may shut down the server identification or hide behind the load balancer (load balancers) or other Web servers such as Apache. If you consider an installed base (installed base), the use of such jetty on a large number of frameworks and tools (such as the Eclipse IDE after version 3.3) will give jetty millions of general usage basics. (If Installedbase is to being considered, then Jetty ' s use in many frameworks and tools (E.g.in the Eclipse IDE from 3.3 Onwa RDS) would give Jetty a regular usage basis inthe.) 3.2. Reference Implementation

Tomcat used to be a reference implementation of serlvet2.4, so it used to be based on the choice of Tomcat. after version 2.5, Tomcat is no longer a serlvet reference implementation. Sun Microsystems the Tomcat server aside and developed GlassFish as serlvet2.5 and serlvet3.0, and also as a reference implementation after JSP2.1.

Instead, jetty closely focuses on the development of normalization, while faithfully realizing it. Jetty developers are also active in the development of SERLVET2.5 's JSR-154 and now serlvet3.0 JSP-315. Therefore, jetty not only follows the development of Serlvet standardization, but also has the ability to influence the continuous improvement of norms and predict the impending changes. 3.3. Development Community

Jetty has a stable development team and process, and has been going on for over 10 years. Starting in 1995 (with Java 0.9 at the time), jetty has been developed by the same core team and has been supported by Mort Bay Consulting, now Webtide LLC and Mortbay. This project exists in the Codehaus.org project library, which can be thought of independently (independently mined). This active Jetty developer team is a medium-scale, healthy, friendly, collaborative team with good features. At the same time, extended communities developed by Jetty have some close collaboration with many other open source projects, such as Maven,activemq,spring,eclipse,jboss,geronimo, and so on.

Tomcat, on the other hand, has an unlucky history because its development community is fragmented, and it has evolved more out of revolution than collaboration or innovation. The Tomcat version evolution from version 3 to 4, 4 to 5, 5 to 5.5, 5.5 to 6 is usually the result of a community split or a core member leaving a project group. The governance and development issues of the Tomcat project reached a peak in the following events:

L lost the status of a reference realization

L Project Branch to GlassFish

L The project changed from Commit&review to Review&commit.

The coming Servlet3.0 will require critical enhancements to all Serlvet servers. A coherent, experienced and tested development team and process will be a key factor in the smooth transition to the new specification and the services and features it supports. 4. Summary

Tomcat is a reasonable quality Java Application Server (the Tomcat project is areasonable quality Java application Server), which has a well-known brand and a huge user base. When it is the protagonist, it can meet the demand well. However, it does lack the flexibility as a software component and the ability to adapt to changing needs as a project and community and to use innovation (adapt to changing requirements and new Innovativeusage) .

The jetty project/team has an attitude and history of responding to innovation and changing needs. It is a software platform with a good architecture that can be integrated and deployed in almost any environment and supported by a large, healthy and growing community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.