Elasticsearch http.tcp.keep_interval Setting

The http.tcp.keep_interval setting in Elasticsearch controls the interval between TCP keep-alive probes for HTTP connections. It helps maintain long-lived connections and detect disconnected clients more quickly.

Description

  • Default value: 75 seconds
  • Possible values: Any positive integer (in seconds)
  • Recommendations: The default value is suitable for most environments. Adjust based on specific network requirements and client behavior.

This setting determines how often TCP keep-alive packets are sent after the initial keep-alive probe. It works in conjunction with other TCP keep-alive settings to manage connection health.

Version Compatibility

This setting is available in Elasticsearch 7.0 and later versions.

Example Usage

To change the http.tcp.keep_interval setting using the cluster settings API:

PUT _cluster/settings
{
  "persistent": {
    "http.tcp.keep_interval": "60s"
  }
}

This example sets the keep-alive interval to 60 seconds. You might want to decrease this value in environments with unreliable networks or frequent client disconnections to detect connection issues more quickly. However, be cautious as very low values can increase network traffic.

Common Issues and Misuses

  • Setting the interval too low can lead to unnecessary network overhead.
  • Setting it too high may delay the detection of disconnected clients.
  • Misalignment with other TCP keep-alive settings can lead to suboptimal connection management.

Do's and Don'ts

  • Do align this setting with your network infrastructure and client behavior.
  • Do consider the impact on network traffic when adjusting this value.
  • Don't set this value extremely low (e.g., below 10 seconds) without a specific reason.
  • Don't ignore this setting if you're experiencing issues with stale connections.

Frequently Asked Questions

Q: How does http.tcp.keep_interval interact with other TCP keep-alive settings?
A: It works alongside http.tcp.keep_alive and http.tcp.keep_count. While keep_alive enables the feature and keep_count sets the number of probes, keep_interval determines the frequency of these probes after the initial one.

Q: Can changing http.tcp.keep_interval affect Elasticsearch performance?
A: While it doesn't directly impact Elasticsearch's processing capabilities, it can affect network performance and connection management. Optimal settings can improve overall system stability and responsiveness.

Q: Is it necessary to restart Elasticsearch after changing this setting?
A: No, when changed via the cluster settings API, it takes effect dynamically without requiring a restart.

Q: How can I determine the optimal value for my environment?
A: Monitor your network behavior, client connection patterns, and any issues with stale connections. Start with the default and adjust gradually while observing the impact.

Q: Does this setting apply to all types of connections to Elasticsearch?
A: This setting specifically applies to HTTP connections. Other protocols or internal node-to-node communications may have separate configurations.

Subscribe to the Pulse Newsletter

Get early access to new Pulse features, insightful blogs & exclusive events , webinars, and workshops.

We use cookies to provide an optimized user experience and understand our traffic. To learn more, read our use of cookies; otherwise, please choose 'Accept Cookies' to continue using our website.