Differences among tomcat, jetty and resin

This is the back-end small class of the monastery. Each article is shared from

[background introduction] [knowledge analysis] [common problems] [solutions] [coding practice] [extended thinking] [more discussion] [References]

Eight aspects of in-depth analysis of back-end knowledge / skills. This article shares:

[difference between tomcat, jetty and resin]

Today, I would like to share with you some knowledge points that may be used in task2 task on the official website of the Academy:

Differences among tomcat, jetty and resin:

Differences among tomcat, jetty and resin_ Tencent video

1. Background introduction

1、 What is Tomcat

Tomcat is the Apache Software Foundation (Apache Software Foundation) a core project in the Jakarta project is developed by Apache, Sun and other companies and individuals. With the participation and support of Sun, the latest Servlet and JSP specification can always be reflected in Tomcat. Tomcat 5 supports the latest 2.4 and 2 specification. Because the technology is advanced and the performance is stable, And free, so it is deeply loved by java lovers and recognized by some software developers. It has become a more popular web application server at present.

2、 What is jetty

Jetty is an open source servlet container that provides a running environment for Java based web containers, such as JSPS and servlets. Jetty is written in the Java language, and its API is published as a set of jar packages. Developers can instantiate the jetty container into an object, which can quickly provide network and web connections for some stand-alone Java applications.

3、 What is resin

Resin is a product of caucho company. It is a very popular application server. It provides good support for servlets and JSPS, and has excellent performance. Resin itself is developed in Java language.

Resin provides the fastest JSP / servlets running platform. With the support of Java and JavaScript, resin can flexibly select the appropriate development language for tasks. As an advanced language of resin, XSL (XML stylesheet language) can separate form and content. If you choose JSP platform as the support of Internet commercial sites, the speed, price and stability should be considered. Resin is very excellent, the performance is more mature, and has the requirements of commercial software.

2. Knowledge analysis

1、 The difference between Tomcat and jetty

1. Similarities:

Tomcat and jetty are both servlet engines. They both support standard servlet specifications and Java EE specifications.

2. Differences:

(1) Architecture

Jetty's architecture is simpler than Tomcat's

Jetty's architecture is implemented based on handler. The main extension functions can be implemented with handler, which is simple to expand.

Tomcat's architecture is based on container design. To expand, you need to understand the overall design structure of tomcat, which is not easy to expand.

(2) Performance aspect

Jetty and Tomcat have little difference in performance

Jetty can handle a large number of connections at the same time and maintain the connection for a long time. It is 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, reduce server memory overhead, and improve server performance.

Jetty adopts NiO by default, which is more advantageous in processing I / O requests and has higher performance in processing static resources

Tomcat is suitable for handling a few very busy links, that is, if the link life cycle is short, the overall performance of Tomcat is higher.

Tomcat uses bio to process I / O requests by default. When processing static resources, the performance is poor.

(3) Other aspects

Jetty's application is faster, easier to modify, and better supports the new servlet specification.

Tomcat is widely used at present. It supports Java EE and servlet more comprehensively, and many features will be directly integrated.

So, compared with tomcat,

Jetty is lighter. In addition to following the java servlet specification, Tomcat also extends a large number of Jee features to meet the needs of enterprise applications. Therefore, Tomcat is a heavyweight and its configuration is much more complex than jetty. However, for a large number of ordinary Internet applications, other advanced features of Tomcat are not required, so in this case, using Tomcat is a waste of resources. This disadvantage is more obvious in the distributed environment. Instead of jetty, each application server saves a few megabytes of memory. For a large distributed environment, it saves a lot of resources. Moreover, jetty's lightweight also makes it faster and more efficient in dealing with high concurrent fine-grained requests.

Jetty is more flexible, which is reflected in its pluggability and scalability. It is easier for developers to carry out secondary development of jetty itself and customize a web server suitable for their own needs. In contrast, the heavyweight Tomcat originally supports too many features, and the cost of slimming it is much greater than the cost of enriching jetty.

However, when supporting large-scale enterprise applications, jetty may need to be extended. In this scenario, Tomcat is better.

2、 The difference between Tomcat and resin

1. Similarities

Both are web servers and support cluster deployment.

2. Differences

(1) Speed aspect

Resin is faster than Tomcat

(2) Mechanism

Resin's startup and shutdown mechanism and error reporting mechanism are better than tomcat, while Tomcat is relatively bloated.

(3) Development environment hot deployment support

Tomcat is better and can be configured as needed. When modifying a JSP or Java file, you can configure whether to restart the service.

The resin is poor. When the class and JSP files are updated, the system will be automatically redeployed and restarted. When the session session is configured, the development is troublesome.

(4) Hot deployment support in production environment

Tomcat is average. When updating the configuration file, you must restart manually. When updating other files, most do not need to restart. However, when too many files are updated at one time, Tomcat restart often fails.

Resin is better. When the configuration file is updated, resin restarts automatically.

3. Frequently asked questions

What kind of web server should I choose for online services?

4. Solutions

According to the difference between them, choose the server that suits you.

For example, jetty meets the needs of the distributed environment of the public cloud, that is, the cloud environment, while Tomcat is more in line with the enterprise environment.

5. Coding practice

6. Expand thinking

These servers have their own advantages and disadvantages. When deploying servers for that website, how should we choose to ensure more efficient operation?

7. References

Document 1: http://www.cnblogs.com/fengli9998/p/7247559.html

Document 2: Baidu

Document 3: http://www.linuxidc.com/Linux/2014-07/104764.htm

8. More discussion

Q: apart from these three web servers, are there any other web servers?

A: there are also IIS, Kangle, WebSphere, Weblogic, Apache, JBoss, etc,

There are also some small ones, such as nginx.

Q: which is better for the official mission of the existing monasteries?

A: jetty

Thank you for watching!

That's all for today's sharing. You are welcome to like, forward, leave messages and make bricks~

Skill tree It Academy

"We believe that everyone can become an engineer. From now on, find a senior brother to introduce you, control your learning rhythm, and stop being confused on the way to learning.".

Here is the skill tree In it academy, thousands of senior brothers have found their own learning route here. Learning is transparent and growth is visible. Senior brothers have 1-to-1 free guidance. Come and study with me~

My invitation code:, or you can click this link directly:

Author: idiot, Wei Wei link: https://www.jianshu.com/p/4f520e7d50f1 Source: the copyright of Jianshu Jianshu belongs to the author. Please contact the author for authorization and indicate the source for any form of reprint.

For more information, you can join the IT communication group 565734203 to discuss and communicate with you

Here is the skill tree · it Academy: a gathering place for beginners to switch to the Internet

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>