Jetty Optimization Guide

By Greg Wilkins

This guide describes techniques for optimizing a deployment of the Jetty HTTP server and servlet container. While some of the techniques described here are particular to the Jetty server, many are generally applicable to any similar servlet server. Note that for a J2EE application server, often it is the web tier that controls the vast majority of requests entering the server. Thus optimization of the web tier is key to the optimization of the entire container.

Optimization is more of an art than a science, so this document does not present a specific solution. Instead the issues and parameters that need to be considered are discussed and "rules of thumb" are given where appropriate.

Optimization Overview

In order to optimize a servlet container it is important to understand how requests are delivered to the container and what resources are used to handle it. This document covers the high level operation of the server and provides a methodology for attaining your performance objectives.

Optimizing Jetty's Configuration

This section covers key configuration parameters that are critical to the performance of the server.

Optimizing Memory

Memory is a key resource that must be managed in any optimization of a web container. This section describes how Jetty manages its use of memory and provides guidelines for applications to efficiently use the server's resources.

Optimizing Threads

Jetty maintains a pool of threads that are used to service requests. This section describes how to size and configure this pool to maximize the performance of the server. It also show how pools can be configured to share resources between applications.

Other Factors

This section covers other optimizations for buffering logging and security.