boost::redis::config::health_check_interval

Time span between successive health checks. Set to zero to disable health‐checks.

Synopsis

Declared in <boost/redis/config.hpp>

std::chrono::steady_clock::duration health_check_interval = std::chrono::seconds{2};

Description

When this value is set to a non‐zero duration, basic_connection::async_run will issue PING commands whenever no command is sent to the server for more than health_check_interval. You can configure the message passed to the PING command using health_check_id.

Enabling health checks also sets timeouts to individual network operations. The connection is considered dead if:

  • No byte can be written to the server after `health_check_interval`.

  • No byte is read from the server after `2 * health_check_interval`.

If the health checker finds that the connection is unresponsive, it will be closed, and a reconnection will be triggered, as if a network error had occurred.

The exact timeout values are not part of the interface, and might change in future versions.

Created with MrDocs