Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] How to configure max requests per connection in Jetty 8?

Hi, 

I'm using Jetty 8 and want to add some sort of periodic "graceful" connection closing. My client's use connection keep-alives. 

Currently, I only close the connection if it has been idle for 60 seconds. However, there is no closing of connections if a client keeps sending occasional requests, say, once every 60 seconds. 

I want to add another closing strategy, which is basically limiting the max number of requests a connections can serve, before the server closes it. The client will be forced to re-connect and I will get better load-balancing :-) 

Tomcat has a setting called maxKeepAliveRequests, which controls this setting. Does Jetty have something similar? If not, is there any sample code to do something similar? 

Thanks
Pranay

PS - This is HTTP spec that talks about this - https://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Keep-Alive

Back to the top