RFR: 8297030: Reduce Default Keep-Alive Timeout Value for httpclient
Conor Cleary
ccleary at openjdk.org
Tue Nov 22 11:28:01 UTC 2022
On Tue, 22 Nov 2022 11:10:14 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
> Proposed changes to reduce the default Keep Alive Timeout value in `jdk/internal/net/http/HttpClientImpl.java` from 1200 seconds to 30 seconds. The current default value of 1200s is needlessly high and in remote connections that allow a client to suggest a value, this will mean that idle connections will wait very long before being dropped.
>
> This value of 30 seconds was chosen by reviewing the current default values for Keep-Alive timeouts in common server implementations and choosing a value that would have the client's default value be lower whenever the value can be set.
>
> Further discussion on this change can be seen the pull request [8288717: Add a means to close idle connections in HTTP/2 connection pool #10183](https://github.com/openjdk/jdk/pull/10183).
Some data on default Keep-Alive values for servers...
- Apache default Keepalive timeout is 15s
- AWS CloudFront default idle connection timeout value is 5-60s
- Load Balancers, tend to have longer defaults. Probably due to queing/access-control systems preparing for high demmand.
- Azure minimum is 240s
- AWS ELB, default of 350s
This data is hard to come by without digging into sources for the above but it is clear that our default should at the very least be lower than present.
-------------
PR: https://git.openjdk.org/jdk/pull/11285
More information about the net-dev
mailing list