Skip to content

Commit

Permalink
docs(pro): slow drain disconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Aug 4, 2023
1 parent 5fc0457 commit ab84063
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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

<p class="pro-badge-header"></p>

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).
Expand Down

0 comments on commit ab84063

Please sign in to comment.