From ab840635c1be47a4f8da94209f4f64e5045f9ad6 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Thu, 3 Aug 2023 22:11:13 -0700 Subject: [PATCH] docs(pro): slow drain disconnection --- docs/configuration.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index 3a5b0228..adf3cbee 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -211,7 +211,7 @@ $ anycable-go \ You can also monitor the current concurrency value via the `rpc_capacity_num` metrics. -## Disconnect events settings +## Disconnect settings AnyCable-Go notifies an RPC server about disconnected clients asynchronously with a rate limit. We do that to allow other RPC calls to have higher priority (because _live_ clients are usually more important) and to avoid load spikes during mass disconnects (i.e., when a server restarts). @@ -239,6 +239,16 @@ Using `--disconnect_mode=always` is useful when you have some logic in the `Appl **NOTE:** AnyCable tries to make a Disconnect call for active sessions during the server shutdown. However, if the server is killed with `kill -9` or crashes, the disconnect queue is not flushed, and some disconnect events may be lost. If you experience higher queue sizes during deployments, consider increasing the shutdown timeout by tuning the `--shutdown_timeout` parameter. +### Slow drain mode + +

+ +AnyCable-Go PRO provides the **slow drain** mode for disconnecting clients during shutdown. When it is enabled, AnyCable do not try to disconnect all active clients as soon as a shutdown signal is received. Instead, spread the disconnects over the shutdown timeout period. + +Use this feature to reduce the load on AnyCable servers during deployments (i.e., to avoid the _thundering herd_ situation). + +**NOTE:** This feature only makes sense if you peform rolling updates, or blue-green deployement, or similar. + ## GOMAXPROCS We use [automaxprocs][] to automatically set the number of OS threads to match Linux container CPU quota in a virtualized environment, not a number of _visible_ CPUs (which is usually much higher).