Version: 9.4.20.v20190813 |

Chapter 20. Optimizing Jetty
Previous | Part III. Jetty Administration Guide Home | Next

##### Contact the core Jetty developers at www.webtide.com

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development

## Chapter 20. Optimizing Jetty

There are many ways to optimize Jetty which vary depending on the situation. Are you trying to optimize for number of requests within a given amount of time? Are you trying to optimize the serving of static content? Do you have a large bit of hardware that you want to give entirely over to Jetty to use to its heart’s delight? This chapter examines a few of the many different ways to optimize Jetty.

## Garbage Collection

Tuning the JVM garbage collection (GC) can greatly improve the performance of the JVM where Jetty and your application are running. Optimal tuning of the GC depends on the behavior of the application(s) and requires detailed analysis, but there are general recommendations to follow to at least obtain comprehensive GC logs that can be later analyzed.

See official Java 8 and Java 9 Garbage Collection documentation for further assistance.

### Garbage Collection Logging Configuration

These options are general to OpenJDK (and therefore also for the Oracle JVM). They provide good information about the GC activity of your JVM, producing logs that can later be analyzed to perform finer tuning.

JDK 8 Garbage Collection Logging Configuration.

    -Xloggc:/path/to/myjettybase/logs/gc.log
    -XX:+PrintGCDateStamps
    -XX:+PrintGCDetails
    -XX:+ParallelRefProcEnabled
    -XX:+PrintReferenceGC
    -XX:+PrintTenuringDistribution
    -XX:+PrintAdaptiveSizePolicy

JDK 9 Garbage Collection Logging Configuration.

    Xlog:gc*,ergo*=trace,ref*=debug,age*=trace:file=/path/to/myjettybase/logs/gc.log:time,level,tags

There are not many recommended options for GC that can apply to all users. However, the most obvious one is to disable explicit GC (this is performed regularly by RMI and can introduce an abnormal amount of GC pauses).

    -XX:+DisableExplicitGC

Previous | Top | Next
Chapter 19. Jetty Runner | Home | High Load

See an error or something missing? Contribute to this documentation at Github!(Generated: 2019-08-13)