-
CSR
-
Resolution: Approved
-
P4
-
behavioral
-
minimal
-
-
Other
-
JDK
Summary
This change reduces the current default Keep Alive Timeout value from 1200 seconds to 30 seconds. Idle connections maintained by the httpclient under both HTTP/1.1 and HTTP/2 will be closed if they stay idle for more than 30 seconds if the default value is used.
Problem
The current default Keep Alive Timeout value of 1200 seconds is uneccessarily high. This means that when a remote allows the client to specify a Keep Alive time (particularly with HTTP/1.1), a client will wait the entire 1200 second duration to close the idle connection even if the server has already dropped it silently. This would be an expected occurence with common load balancer implementations experiencing high demmand having a need to silently drop client connections.
Solution
The default value for Keep Alive timeouts with the httpclient has been reduced from 1200 seconds to 30 seconds, significantly decreasing the duration before idle connections (for both HTTP/1.1 and HTTP/2) are closed by default.
Specification
This following change to the specification is located in src/java.net.http/share/classes/module-info.java:99
- * <li><p><b>{@systemProperty jdk.httpclient.keepalive.timeout}</b> (default: 1200)<br>
+ * <li><p><b>{@systemProperty jdk.httpclient.keepalive.timeout}</b> (default: 30)<br>
* The number of seconds to keep idle HTTP connections alive in the keep alive cache. This property
* applies to both HTTP/1.1 and HTTP/2. The value for HTTP/2 can be overridden with the
* jdk.httpclient.keepalive.timeout.h2 property.
* </li>
This specification change will be carried out by this fix JDK-8297030 or by JDK-8296804 depending on whether or not JDK-8297030 is merged first.
- csr of
-
JDK-8297030 Reduce Default Keep-Alive Timeout Value for httpclient
-
- Resolved
-
- relates to
-
JDK-8296804 Document HttpClient configuration properties in java.net.http module-info
-
- Resolved
-
-
JDK-8295649 Add a means to close idle connections in HTTP/2 connection pool
-
- Closed
-