Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you set the timeout on keep alive connections to the Jetty web server (in my case v6.1.19)?

I would like to configure how long Jetty keeps connections open when a client requests keep alive. Currently it seems indefinite.

share|improve this question

This can be configured by setting the "maxIdleTime" on the socket connector. See Configuring Connectors

For example in jetty.xml

<Call name="addConnector">
    <New class="org.mortbay.jetty.nio.SelectChannelConnector">
        <Set name="maxIdleTime">10000</Set>

From the manual:

Set the maximum Idle time for a connection, which roughly translates to the Socket.setSoTimeout(int) call, although with NIO implementations other mechanisms may be used to implement the timeout.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.