Today see Sy's SSH project, with MAVEN integrated jetty server, curious to see the next, jetty and Tomcat comparison, as follows:
Comparison of Jetty and Tomcat
Same point:
1. Tomcat and jetty are both servlet engines that support standard servlet specifications and Java EE specifications.
Different points:
1. Architecture Comparison
Jetty's architecture is simpler than Tomcat's
The architecture of Jetty is based on handler, and the main extension functions can be implemented with handler, which is easy to extend.
Tomcat's architecture is container-based, and scaling is an understanding of the overall design structure of Tomcat and is not easy to scale.
2. Performance comparison
Jetty and Tomcat have little difference in performance
Jetty can handle a large number of connections at the same time and can stay connected for long periods, suitable for web chat applications and so on.
Jetty's architecture is simple, so as a server, jetty can load components on demand, reduce unnecessary components, and reduce server memory overhead to improve server performance.
Jetty defaults to NiO end for processing I/O requests with higher performance when dealing with static resources
Tomcat is good at dealing with a handful of very busy links, which means that the overall performance of Tomcat is higher in the short link life cycle.
Tomcat handles I/O requests by default with bio, which performs poorly when dealing with static resources.
3. Other comparisons
Jetty is faster, easier to modify, and better to support the new servlet specification.
Tomcat is now widely used, with more comprehensive support for Java EE and Servlets, and many features are directly integrated.
Three kinds of comparisons between jetty and Tomcat