SlideShare a Scribd company logo
1 of 33
Tomcat, Undertow, Jetty,
Nginx Unit
Pros and cons
1
• Features
• Performance
• Maintainability
• Security
• Extensibility
• Summary
2
Agenda
• The following Java specifications were considered for this analysis:
• Servlet (JSR 369)
• JSP (JSR 152)
• Expression Language (JSR 341)
• Web Sockets (JSR 356)
• Java NIO/NIO.2 (JSR 203)
• HTTP 2 (JEP 110)
3
Features
Features
4
Click to edit
Tomcat Undertow Jetty Nginx Unit
Servlet 4.0 4.0 4.0 3.1
JSP 2.3 2.3 2.3 2.3
Expression Language 3.0 3.0 3.0 3.0
Web Sockets 1.1 1.1 1.1 1.1
Java NIO/NIO.2 ✅ ✅ ✅ C backend
HTTP 2 ✅ ✅ ✅ ❌
• What is Performance?
• What is Scalability?
• Horizontal/Vertical Scalability
• Summary
5
Performance
• There are several definitions for performance
In here, the throughput definition used
6
What is Performance?
“Premature optimization is the root of all evil.”
- Donald Knuth
“Throughput is the rate of
production or the rate at which
something is processed.”
- Wikipedia on Throughput
• Any system is a network of queues
7
What is Performance?
8
What is Scalability?
“Scalability is the property of a
system to handle a growing
amount of work by adding
resources to the system.”
- Wikipedia on Scalability
9
Horizontal/Vertical Scalability
“Horizontal scaling means that
you scale by adding more machines
into your pool of resources whereas
Vertical scaling means that
you scale by adding more power
(CPU, RAM) to an existing machine.”
- Stack Overflow answer on Scalability
• In general, they have the same performance
• Nginx Unit is still in beta stage as in November 2019
• But it is very promising (multiple programming languages, DPDK, …)
• Jetty, Undertow and Tomcat have some minor performance
differences, but configuration can mitigate it
10
Performance Summary
Tomcat Undertow Jetty Nginx Unit
Keep Tomcat if already using it
Always configure NIO.2
Use Undertow/WildFly (JBoss) if
your webapp requires full JEE
support
Use Jetty when hardware
resources are limited
Not enough data
to recommend
• What is software maintainability?
• Used metrics
• Documentation
• Lines of code
• Test coverage
• Summary
11
Maintainability
“The ease with which a software
system or component can be
modified to correct faults,
improve performance or other
attributes, or adapt to a changed
environment.”
- IEEE Glossary of Software Eng.
12
What is Software Maintainability?
“The maintainability of software
depends on a few different factors.
In general, it must be easy to
understand the software
(how it works, what it does,
and why it does it the way it does),
easy to find what needs to be
change, easy to make changes
and easy to check
that the changes have not
introduced any bugs.”
- UK Software Sustainability Institute
• All projects are well documented
• Tomcat is the winner here once it is the most popular web
application server with many years of documented troubleshooting
including Undertow/Wildfly
13
Documentation
• Lines of code is a classic maintainability metric
14
Lines of Code
Total Lines of Code
Tomcat
(9.0.27)
Undertow
(Wildfly 18.0.0)
Jetty
(9.4.22)
Nginx Unit
(master branch 20191023)
430.507
820.318
(contains JEE apis too)
565.122 94.925
“All code is technical debt;
Some code just has a higher interest rate.”
- Paul McMahon
• Tomcat and Nginx Unit does not follow the maven project structure
• Undertow and Jetty are maven projects with a cleaner structure and
code base
• Test Coverage could not be checked because each web application
server has a different approach on test
• Tomcat has many tests against regressions
• Nginx Unit has many tests against java specifications (the JSR-XXX)
• Undertow and Jetty use standard maven for most of the components that
are covered but not all (as in 2019-10-23)
15
Test Coverage
16
Maintainability Summary
• Tomcat has more documentation on troubleshooting
• Undertow, Jetty and Nginx Unit have a much cleaner code case with
more coverage
• OWASP has several general and specific recommendations
• Common Vulnerabilities and Exposures (CVE) are considered here
17
Security
Tomcat Vulnerabilities
18
Click to editYear
# of
Vulnerabiliti
es
DoS
Code
Execution
Overflow XSS
Directory
Traversal
Http
Response
Splitting
Bypass
something
Gain
Information
Gain
Privileges
CSRF
2016 12 2 1 2 5 1 3 1
2017 22 1 3 1 1 1 5 7 2
2018 8 1 1
2019 4 1 1
% Of All 16.4 4.1 3.5 13.5 7.0 0.0 20.5 18.7 4.1 2.3
Source: https://www.cvedetails.com/product/887/Apache-Tomcat.html
WildFly Vulnerabilities
19
Click to editYear
# of
Vulnerabiliti
es
DoS
Code
Execution
Overflow XSS
Directory
Traversal
Http
Response
Splitting
Bypass
something
Gain
Information
Gain
Privileges
CSRF
2016 2 1 1
2017 1 1
2018 2 1 1
2019
(N/A)
% Of All 22.2 0.0 11.1 0.0 11.1 11.1 0.0 22.2 0.0 11.1
Source: https://www.cvedetails.com/product/27107/Redhat-Jboss-Wildfly-Application-Server.html
Jetty Vulnerabilities
20
Click to editYear
# of
Vulnerabiliti
es
DoS
Code
Execution
Overflow XSS
Directory
Traversal
Http
Response
Splitting
Bypass
something
Gain
Information
Gain
Privileges
CSRF
2016 1 1
2017 2 1 1
2018 5 1 2 1
2019 4 1 1 2
% Of All 8.3 0.0 8.3 8.3 0.0 0.0 25.0 41.7 0.0 0.0
Source: https://www.cvedetails.com/product/34824/Eclipse-Jetty.html
21
Security Summary
• There are no CVE data regarding Nginx Unit (as in November 2019)
• Once it’s written in C, we can infer it may have a greater number of
vulnerabilities than a pure java-based web application server
• Tomcat is clearly more vulnerable than the others
• Jetty comes next
• Undertow/Wildfly is the least vulnerable but there is not data for
2019
• Servlet Filter
• Application/Container wide Filter
• Tomcat Valve
• Undertow HttpHandler
• Jetty Handler
• Nginx Unit Routes
22
Extensibility
23
Servlet Filter
What is a filter?
“A filter is a reusable piece of code that can
transform the content of HTTP requests,
responses, and header information.
Filters do not generally create a response or
respond to a request as servlets do, rather they
modify or adapt the requests for a resource,
modify or adapt responses from a resource.”
- Java Servlet 4.0 specification
24
Tomcat Valve
What is a Tomcat Valve?
“A Valve element represents
a component that will be inserted
into the request processing pipeline
for the associated Catalina container
(Engine, Host, or Context).
Individual Valves have distinct
processing capabilities (…)”
- Tomcat documentation
25
Undertow HttpHandler
Undertow HttpHandler Behaviour
“Handlers are generally chained together by
explicitly specifying the next handler at
construction time, there is no pipeline concept,
which means that a handler can pick the next
handler to invoke based on the current request.”
- Undertow documentation
26
Jetty Handler
Jetty Handler Behaviour
“The Handler is the Jetty
component that deals with
HTTP requests and responses.”
- Jetty documentation
Nginx Unit Routes Behaviour
“Nginx Unit configuration offers a routes
object to enable elaborate internal
routing between listeners and apps.
Listeners pass requests to routes
or directly to apps.
Requests are matched against route
step conditions; a request matching all
conditions of a step is passed to the app
or the route that the step specifies.”
- Nginx Unit documentation
27
Nginx Unit Routes
28
Extensibility Summary
• Nginx Unit is a clear winner once the route configuration forces the
web application decoupling
• Tomcat, Undertow, Jetty are equivalent on extensibility but their
architecture are very different
29
Summary
Tomcat Undertow Jetty Nginx Unit
Features
Tomcat, Undertow and Jetty are equivalent
Use Undertow if JEE support is required
Still in development
Performance
Keep Tomcat if you
already have it
Undertow has an
equivalent performance
with Tomcat
Use Jetty for resource
constrained
environments such as
cloud
Not enough data to
recommend
Maintainability
Tomcat wins on
documentation and
troubleshooting
Undertow, Jetty and Unit are pretty much equivalent on maintainability with a
much cleaner code base
Security
Tomcat has more
vulnerabilities than the
others
Undertow is the least
vulnerable but there is no
data for 2019
Jetty is the second most
vulnerable
No CVEs for Unit
Extensibility
Tomcat, Undertow and Jetty are equivalent
Unit has a better approach by proposing decouple web applications to talk to each other with routes
• JSR 152: JavaServer Pages Specification
• JSR 203: Java NIO/NIO.2
• JSR 341: Expression Language
• JSR 356: Java API for WebSocket
• JSR 369: Java Servlet Specification
• JSR 372: JavaServer Faces Specification
• JEP 110: HTTP/2 Client
30
References
• Apache Tomcat
• Undertow
• Jetty
• Nginx Unit
• Tomcat vs. Jetty vs. Undertow: Comparison of Spring Boot Embedded
Servlet Containers
• Top Java Application Servers: Tomcat vs. Jetty vs. GlassFish vs. WildFly
• JBoss vs. Tomcat: Choosing A Java Application Server
• Tomcat vs Jetty vs Wildfly runtime comparision
31
References
• Low level programming
Igor Zhirkov
Apress
• Systems Performance – enterprise and the cloud
Brendan Gregg
Prentice Hall
• Performance modeling and design of computer systems
Mor Harchol-Balter
Cambridge University Press
• Operating System Concepts
Silberschatz, Gagne, Galvin
John Wiley & Sons
32
References
33
Thank you!
Geraldo Netto
geraldo.netto@gmail.com

More Related Content

What's hot

外部キー制約に伴うロックの小話
外部キー制約に伴うロックの小話外部キー制約に伴うロックの小話
外部キー制約に伴うロックの小話ichirin2501
 
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization Technique
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization TechniqueSquare Engineering's "Fail Fast, Retry Soon" Performance Optimization Technique
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization TechniqueScyllaDB
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)Kentaro Ebisawa
 
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)Shinya Sugiyama
 
Boost UDP Transaction Performance
Boost UDP Transaction PerformanceBoost UDP Transaction Performance
Boost UDP Transaction PerformanceLF Events
 
MySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slaveMySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slaveTakanori Sejima
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsBrendan Gregg
 
InnoDBのすゝめ(仮)
InnoDBのすゝめ(仮)InnoDBのすゝめ(仮)
InnoDBのすゝめ(仮)Takanori Sejima
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいwata2ki
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
NAND Flash から InnoDB にかけての話(仮)
NAND Flash から InnoDB にかけての話(仮)NAND Flash から InnoDB にかけての話(仮)
NAND Flash から InnoDB にかけての話(仮)Takanori Sejima
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析Mr. Vengineer
 
フィッシングとドメイン名・DNS
フィッシングとドメイン名・DNSフィッシングとドメイン名・DNS
フィッシングとドメイン名・DNSShiojiri Ohhara
 
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...Yahoo!デベロッパーネットワーク
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamSATOSHI TAGOMORI
 
[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅NAVER D2
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt AffinityについてTakuya ASADA
 

What's hot (20)

外部キー制約に伴うロックの小話
外部キー制約に伴うロックの小話外部キー制約に伴うロックの小話
外部キー制約に伴うロックの小話
 
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization Technique
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization TechniqueSquare Engineering's "Fail Fast, Retry Soon" Performance Optimization Technique
Square Engineering's "Fail Fast, Retry Soon" Performance Optimization Technique
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)
MySQL InnoDB Clusterによる高可用性構成(DB Tech Showcase 2017)
 
Boost UDP Transaction Performance
Boost UDP Transaction PerformanceBoost UDP Transaction Performance
Boost UDP Transaction Performance
 
OpenStack HA
OpenStack HAOpenStack HA
OpenStack HA
 
MySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slaveMySQL5.7 GA の Multi-threaded slave
MySQL5.7 GA の Multi-threaded slave
 
Apache Pulsarの概要と近況
Apache Pulsarの概要と近況Apache Pulsarの概要と近況
Apache Pulsarの概要と近況
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
InnoDBのすゝめ(仮)
InnoDBのすゝめ(仮)InnoDBのすゝめ(仮)
InnoDBのすゝめ(仮)
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくい
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
NAND Flash から InnoDB にかけての話(仮)
NAND Flash から InnoDB にかけての話(仮)NAND Flash から InnoDB にかけての話(仮)
NAND Flash から InnoDB にかけての話(仮)
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
 
フィッシングとドメイン名・DNS
フィッシングとドメイン名・DNSフィッシングとドメイン名・DNS
フィッシングとドメイン名・DNS
 
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...
スキーマレスカラムナフォーマット「Yosegi」で実現する スキーマの柔軟性と処理性能を両立したログ収集システム / Hadoop / Spark Con...
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅[232] 성능어디까지쥐어짜봤니 송태웅
[232] 성능어디까지쥐어짜봤니 송태웅
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
 

Similar to Tomcat, Undertow, Jetty, Nginx Unit: pros and cons

Introduction to Apache Tomcat 7 Presentation
Introduction to Apache Tomcat 7 PresentationIntroduction to Apache Tomcat 7 Presentation
Introduction to Apache Tomcat 7 PresentationTomcat Expert
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikEdgar Espina
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by OracleAkash Pramanik
 
Performance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsPerformance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsMaarten Smeets
 
Session 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionSession 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionPawanMM
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction Hitesh-Java
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsMaarten Smeets
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dbaOsama Mustafa
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Arun Gupta
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Comparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systemsComparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systemsImesha Sudasingha
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...Frank Munz
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 

Similar to Tomcat, Undertow, Jetty, Nginx Unit: pros and cons (20)

Introduction to Apache Tomcat 7 Presentation
Introduction to Apache Tomcat 7 PresentationIntroduction to Apache Tomcat 7 Presentation
Introduction to Apache Tomcat 7 Presentation
 
Jetty Vs Tomcat
Jetty Vs TomcatJetty Vs Tomcat
Jetty Vs Tomcat
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip Hanik
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by Oracle
 
Performance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsPerformance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMs
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
Session 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionSession 41 - Struts 2 Introduction
Session 41 - Struts 2 Introduction
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Comparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systemsComparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systems
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 

Recently uploaded

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Tomcat, Undertow, Jetty, Nginx Unit: pros and cons

  • 1. Tomcat, Undertow, Jetty, Nginx Unit Pros and cons 1
  • 2. • Features • Performance • Maintainability • Security • Extensibility • Summary 2 Agenda
  • 3. • The following Java specifications were considered for this analysis: • Servlet (JSR 369) • JSP (JSR 152) • Expression Language (JSR 341) • Web Sockets (JSR 356) • Java NIO/NIO.2 (JSR 203) • HTTP 2 (JEP 110) 3 Features
  • 4. Features 4 Click to edit Tomcat Undertow Jetty Nginx Unit Servlet 4.0 4.0 4.0 3.1 JSP 2.3 2.3 2.3 2.3 Expression Language 3.0 3.0 3.0 3.0 Web Sockets 1.1 1.1 1.1 1.1 Java NIO/NIO.2 ✅ ✅ ✅ C backend HTTP 2 ✅ ✅ ✅ ❌
  • 5. • What is Performance? • What is Scalability? • Horizontal/Vertical Scalability • Summary 5 Performance
  • 6. • There are several definitions for performance In here, the throughput definition used 6 What is Performance? “Premature optimization is the root of all evil.” - Donald Knuth “Throughput is the rate of production or the rate at which something is processed.” - Wikipedia on Throughput
  • 7. • Any system is a network of queues 7 What is Performance?
  • 8. 8 What is Scalability? “Scalability is the property of a system to handle a growing amount of work by adding resources to the system.” - Wikipedia on Scalability
  • 9. 9 Horizontal/Vertical Scalability “Horizontal scaling means that you scale by adding more machines into your pool of resources whereas Vertical scaling means that you scale by adding more power (CPU, RAM) to an existing machine.” - Stack Overflow answer on Scalability
  • 10. • In general, they have the same performance • Nginx Unit is still in beta stage as in November 2019 • But it is very promising (multiple programming languages, DPDK, …) • Jetty, Undertow and Tomcat have some minor performance differences, but configuration can mitigate it 10 Performance Summary Tomcat Undertow Jetty Nginx Unit Keep Tomcat if already using it Always configure NIO.2 Use Undertow/WildFly (JBoss) if your webapp requires full JEE support Use Jetty when hardware resources are limited Not enough data to recommend
  • 11. • What is software maintainability? • Used metrics • Documentation • Lines of code • Test coverage • Summary 11 Maintainability
  • 12. “The ease with which a software system or component can be modified to correct faults, improve performance or other attributes, or adapt to a changed environment.” - IEEE Glossary of Software Eng. 12 What is Software Maintainability? “The maintainability of software depends on a few different factors. In general, it must be easy to understand the software (how it works, what it does, and why it does it the way it does), easy to find what needs to be change, easy to make changes and easy to check that the changes have not introduced any bugs.” - UK Software Sustainability Institute
  • 13. • All projects are well documented • Tomcat is the winner here once it is the most popular web application server with many years of documented troubleshooting including Undertow/Wildfly 13 Documentation
  • 14. • Lines of code is a classic maintainability metric 14 Lines of Code Total Lines of Code Tomcat (9.0.27) Undertow (Wildfly 18.0.0) Jetty (9.4.22) Nginx Unit (master branch 20191023) 430.507 820.318 (contains JEE apis too) 565.122 94.925 “All code is technical debt; Some code just has a higher interest rate.” - Paul McMahon
  • 15. • Tomcat and Nginx Unit does not follow the maven project structure • Undertow and Jetty are maven projects with a cleaner structure and code base • Test Coverage could not be checked because each web application server has a different approach on test • Tomcat has many tests against regressions • Nginx Unit has many tests against java specifications (the JSR-XXX) • Undertow and Jetty use standard maven for most of the components that are covered but not all (as in 2019-10-23) 15 Test Coverage
  • 16. 16 Maintainability Summary • Tomcat has more documentation on troubleshooting • Undertow, Jetty and Nginx Unit have a much cleaner code case with more coverage
  • 17. • OWASP has several general and specific recommendations • Common Vulnerabilities and Exposures (CVE) are considered here 17 Security
  • 18. Tomcat Vulnerabilities 18 Click to editYear # of Vulnerabiliti es DoS Code Execution Overflow XSS Directory Traversal Http Response Splitting Bypass something Gain Information Gain Privileges CSRF 2016 12 2 1 2 5 1 3 1 2017 22 1 3 1 1 1 5 7 2 2018 8 1 1 2019 4 1 1 % Of All 16.4 4.1 3.5 13.5 7.0 0.0 20.5 18.7 4.1 2.3 Source: https://www.cvedetails.com/product/887/Apache-Tomcat.html
  • 19. WildFly Vulnerabilities 19 Click to editYear # of Vulnerabiliti es DoS Code Execution Overflow XSS Directory Traversal Http Response Splitting Bypass something Gain Information Gain Privileges CSRF 2016 2 1 1 2017 1 1 2018 2 1 1 2019 (N/A) % Of All 22.2 0.0 11.1 0.0 11.1 11.1 0.0 22.2 0.0 11.1 Source: https://www.cvedetails.com/product/27107/Redhat-Jboss-Wildfly-Application-Server.html
  • 20. Jetty Vulnerabilities 20 Click to editYear # of Vulnerabiliti es DoS Code Execution Overflow XSS Directory Traversal Http Response Splitting Bypass something Gain Information Gain Privileges CSRF 2016 1 1 2017 2 1 1 2018 5 1 2 1 2019 4 1 1 2 % Of All 8.3 0.0 8.3 8.3 0.0 0.0 25.0 41.7 0.0 0.0 Source: https://www.cvedetails.com/product/34824/Eclipse-Jetty.html
  • 21. 21 Security Summary • There are no CVE data regarding Nginx Unit (as in November 2019) • Once it’s written in C, we can infer it may have a greater number of vulnerabilities than a pure java-based web application server • Tomcat is clearly more vulnerable than the others • Jetty comes next • Undertow/Wildfly is the least vulnerable but there is not data for 2019
  • 22. • Servlet Filter • Application/Container wide Filter • Tomcat Valve • Undertow HttpHandler • Jetty Handler • Nginx Unit Routes 22 Extensibility
  • 23. 23 Servlet Filter What is a filter? “A filter is a reusable piece of code that can transform the content of HTTP requests, responses, and header information. Filters do not generally create a response or respond to a request as servlets do, rather they modify or adapt the requests for a resource, modify or adapt responses from a resource.” - Java Servlet 4.0 specification
  • 24. 24 Tomcat Valve What is a Tomcat Valve? “A Valve element represents a component that will be inserted into the request processing pipeline for the associated Catalina container (Engine, Host, or Context). Individual Valves have distinct processing capabilities (…)” - Tomcat documentation
  • 25. 25 Undertow HttpHandler Undertow HttpHandler Behaviour “Handlers are generally chained together by explicitly specifying the next handler at construction time, there is no pipeline concept, which means that a handler can pick the next handler to invoke based on the current request.” - Undertow documentation
  • 26. 26 Jetty Handler Jetty Handler Behaviour “The Handler is the Jetty component that deals with HTTP requests and responses.” - Jetty documentation
  • 27. Nginx Unit Routes Behaviour “Nginx Unit configuration offers a routes object to enable elaborate internal routing between listeners and apps. Listeners pass requests to routes or directly to apps. Requests are matched against route step conditions; a request matching all conditions of a step is passed to the app or the route that the step specifies.” - Nginx Unit documentation 27 Nginx Unit Routes
  • 28. 28 Extensibility Summary • Nginx Unit is a clear winner once the route configuration forces the web application decoupling • Tomcat, Undertow, Jetty are equivalent on extensibility but their architecture are very different
  • 29. 29 Summary Tomcat Undertow Jetty Nginx Unit Features Tomcat, Undertow and Jetty are equivalent Use Undertow if JEE support is required Still in development Performance Keep Tomcat if you already have it Undertow has an equivalent performance with Tomcat Use Jetty for resource constrained environments such as cloud Not enough data to recommend Maintainability Tomcat wins on documentation and troubleshooting Undertow, Jetty and Unit are pretty much equivalent on maintainability with a much cleaner code base Security Tomcat has more vulnerabilities than the others Undertow is the least vulnerable but there is no data for 2019 Jetty is the second most vulnerable No CVEs for Unit Extensibility Tomcat, Undertow and Jetty are equivalent Unit has a better approach by proposing decouple web applications to talk to each other with routes
  • 30. • JSR 152: JavaServer Pages Specification • JSR 203: Java NIO/NIO.2 • JSR 341: Expression Language • JSR 356: Java API for WebSocket • JSR 369: Java Servlet Specification • JSR 372: JavaServer Faces Specification • JEP 110: HTTP/2 Client 30 References
  • 31. • Apache Tomcat • Undertow • Jetty • Nginx Unit • Tomcat vs. Jetty vs. Undertow: Comparison of Spring Boot Embedded Servlet Containers • Top Java Application Servers: Tomcat vs. Jetty vs. GlassFish vs. WildFly • JBoss vs. Tomcat: Choosing A Java Application Server • Tomcat vs Jetty vs Wildfly runtime comparision 31 References
  • 32. • Low level programming Igor Zhirkov Apress • Systems Performance – enterprise and the cloud Brendan Gregg Prentice Hall • Performance modeling and design of computer systems Mor Harchol-Balter Cambridge University Press • Operating System Concepts Silberschatz, Gagne, Galvin John Wiley & Sons 32 References