Review of Servlet Engines and Servlet Plugins

This review is now very old and we encourage third parties to benchmark all the popular HTTP Server and Servlet container combinations.

In early 2000, "iX Magazine" did a testing on 6 servlet engines and servlet plugins. The candidates were:

- ServletExec 2.2 (with Apache 1.3.9)
- Jetty 2.2.4
- Java Webserver 2.0
- Jserv 1.0 (with Apache 1.3.6)
- Jigsaw 2.0.3
- JRun Pro 2.3.2 (with Apache 1.3.6)

The article was written by Hendrik Schreiber <hs@tagtraum.com> whose site is http://www.tagtraum.com. Hendrik developed the Jo java WWW server. An update for the latest jetty is included below.

### Results:

Results are the max requests per second reached, regardless of the used protocol. FileServlet results were weighed according to a real world distribution, APIMethodTest was only tested with a simple HTTP/1.0 client.

Server | FileServlet Content-Length | FileServlet no Content-Length | HelloWorld Servlet | APIMethodTest Servlet
--- | --- | --- | --- | ---

Jetty 2.2.4

189

210

250

175

Jigsaw 2.0.3

181

184

262

137

Java Webserver 2.0

166

152

105

174

JSERV 1.0

93

91

104

99

JRUN PRO 2.3.2

68

72

115

72

Servlet Exec 2.2

54

53

70

67

### Servlets:

- A simple file servlet that is using the content-length header field when serving files. The served files were of different sizes: 1 Byte, 100 Byte and 1, 10, 100, 1000 kByte. The number of requests for the different file sizes were chosen in a realistic distribution (0-1kByte 35%, 1-10kByte 50%, 10-100kByte 14%, 100-1Mbyte 1%).
- A "hello world" servlet (no content-length header)
- A more complex servlet that is using most of the Servlet API 2.0 methods (setting headers, cookies but no sessions).

You will find the source code under: ftp://ftp.heise.de/pub/ix/ix_listings/2000/01/

### Clients:

- A basic HTTP 1.0 client
- HTTP 1.0 with "Keep-Alive" (like Netscape 4.6)
- HTTP 1.1 without Pipelining (IE 5.0)
- HTTP 1.1 with Pipelining

### Hardware:

4 clients, 1 server, 1 controller all the same hardware: PII 400MHz, 128Mbyte, Asus P2B, 100Mbit, NT4 SP5

### Software:

Sun's JDK 1.2.2 with JIT, restricted to 100 handler threads per machine. Unlike many other vendor benchmarks the test aimed at a high level of concurrency of up to 400 concurrent requests, in order to not only measure isolated, sequential roundtrip times, but a more realistic heavyload situation.

### Discussion:

In the end the pure java servers were twice as fast as the plugins. Jetty was the fastest servlet engine (Jigsaw was a bit faster with the "Hello world"). Jigsaw had problems with the URL-rewriting the RequestDispatcher . Every call to encodeURL() did create a session-that leads to a memory hole and the machines crashed. Jetty's implementation of HTTP 1.1 was criticised. IE 5.0 sometimes did not get a response and Pipelining did not work properly. Additionally Jetty wrote some content in the language of the installed JDK, so the tests on the German installation with GET and the "If-Modified" header failed too.

### Jetty Update

- All the Jetty problems described in the article have been fixed since Jetty-2.3.5 and Jetty-3.0.0.
- Jetty-3 has been implemented against RFC2616 and is fully HTTP/1.1 compliant.
- Jetty-3 has increased base throughput over Jetty-2 by about 15%. This is without considering the other performance improvements from HTTP/1.1 and the 2.3 servlet API including:
  + Persistent connections for most dynamic content.
  + Range support for partial GET's.
  + Request forwarding removes need for many client redirects.
- Jetty-3 has yet to be thoroughly independantly tested against the latest breed of Servlet containers - but we are more than happy to contribute to any such effort.
- The Jetty-3 footprint has remained small. A complete HTTP server and servlet container can be contained in a 250KB jar file. Just an extensible HTTP/1.1 server is only a 170KB jar file.