mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
refactor: optimize heartbeat channel and etcd client keepalive settings (#7390)
Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
@@ -47,21 +47,16 @@ pub const META_KEEP_ALIVE_INTERVAL_SECS: u64 = META_LEASE_SECS / 2;
|
|||||||
pub const HEARTBEAT_TIMEOUT: Duration = Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS + 1);
|
pub const HEARTBEAT_TIMEOUT: Duration = Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS + 1);
|
||||||
|
|
||||||
/// The keep-alive interval of the heartbeat channel.
|
/// The keep-alive interval of the heartbeat channel.
|
||||||
pub const HEARTBEAT_CHANNEL_KEEP_ALIVE_INTERVAL_SECS: Duration =
|
pub const HEARTBEAT_CHANNEL_KEEP_ALIVE_INTERVAL_SECS: Duration = Duration::from_secs(15);
|
||||||
Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS + 1);
|
|
||||||
|
|
||||||
/// The keep-alive timeout of the heartbeat channel.
|
/// The keep-alive timeout of the heartbeat channel.
|
||||||
pub const HEARTBEAT_CHANNEL_KEEP_ALIVE_TIMEOUT_SECS: Duration =
|
pub const HEARTBEAT_CHANNEL_KEEP_ALIVE_TIMEOUT_SECS: Duration = Duration::from_secs(5);
|
||||||
Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS + 1);
|
|
||||||
|
|
||||||
/// The default options for the etcd client.
|
/// The default options for the etcd client.
|
||||||
pub fn default_etcd_client_options() -> ConnectOptions {
|
pub fn default_etcd_client_options() -> ConnectOptions {
|
||||||
ConnectOptions::new()
|
ConnectOptions::new()
|
||||||
.with_keep_alive_while_idle(true)
|
.with_keep_alive_while_idle(true)
|
||||||
.with_keep_alive(
|
.with_keep_alive(Duration::from_secs(15), Duration::from_secs(5))
|
||||||
Duration::from_secs(META_KEEP_ALIVE_INTERVAL_SECS + 1),
|
|
||||||
Duration::from_secs(10),
|
|
||||||
)
|
|
||||||
.with_connect_timeout(Duration::from_secs(10))
|
.with_connect_timeout(Duration::from_secs(10))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user