-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
We should confirm that our TCP keep alive options are compliant with this specification (DRIVERS-383), the default value for the seconds does match what we use in the driver.
Specification
- A driver MUST enable TCP keepalive by default. This matches the behavior of the MongoDB server.
- A driver MUST deprecate TCP keepalive-related options in the connection string (and any other way that it is configured), as there is no demonstrated benefit to allowing it to be disabled. This also matches the behavior of the server.
- A driver SHOULD set tcp_keepalive_time to 300 seconds unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it. This matches the behavior of the server as well.
- A driver SHOULD set tcp_keepalive_intvl to 10 seconds unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it. This is not the current behavior of the server, but if accepted here it will be recommended. The reasoning is that with the default of 75 seconds for this value and a default of 9 probes, the actual time to failure is 300 + (75 * 9) = 975 sec = 16.25 minutes. With a 10 second interval between probes it becomes a more reasonable 6.5 minutes.
- A driver SHOULD set tcp_keepalive_cnt to 9 probes unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it.
- A driver MUST document how keepalive-related options are configured. Drivers that can set tcp_keepalive_time and tcp_keepalive_intvl to the values mandated above MUST document that they do so. Drivers that can not MUST document that they do not and link to appropriate MongoDB Diagnostics FAQ keepalive section for instructions on setting these values at the system level.
- clones
-
NODE-1024 Have TCP keepalive default to true
- Closed
- is cloned by
-
NODE-5190 Implement correct TCP keepalive defaults
- Closed
- is related to
-
NODE-6245 Restore keepAliveInitialDelay configurability
- Backlog
-
NODE-3270 Enable TCP_USER_TIMEOUT by default when possible
- Closed
- related to
-
NODE-5189 Deprecate tcp keepalive options
- Closed