Skip to content

Embedded Jetty uses unbounded QueuedThreadPool by default. #8662

Closed
@jzampieron

Description

@jzampieron

The default behavior for jetty when used in spring boot is for the
JettyEmbeddedServletContainerFactory to create an Jetty Server with an unbounded
QueuedThreadPool.

This means that under any kind of load where the input request rates exceeds the servers ability to process that the JVM will eventually OOM no matter what.

Essentially, this is a guaranteed breakage by default.

Instead it would be better to replace the default BlockingQueue inside the QueuedThreadPool with a bounded queue, as is advised in the Jetty documentation.

This changes the default behavior to load shed (fail fast) and is far more production ready out of the box.

(See https://wiki.eclipse.org/Jetty/Howto/High_Load#Jetty_Tuning - dated by still reflected in the code.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions