提交 716f69b8 作者: Steven Allen

config: document the connection manager

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 7956adad
...@@ -311,6 +311,7 @@ Tells reprovider what should be announced. Valid strategies are: ...@@ -311,6 +311,7 @@ Tells reprovider what should be announced. Valid strategies are:
- "roots" - only announce directly pinned keys and root keys of recursive pins - "roots" - only announce directly pinned keys and root keys of recursive pins
## `Swarm` ## `Swarm`
Options for configuring the swarm. Options for configuring the swarm.
- `AddrFilters` - `AddrFilters`
...@@ -334,15 +335,41 @@ Enables HOP relay for the node. If this is enabled, the node will act as ...@@ -334,15 +335,41 @@ Enables HOP relay for the node. If this is enabled, the node will act as
an intermediate (Hop Relay) node in relay circuits for connected peers. an intermediate (Hop Relay) node in relay circuits for connected peers.
### `ConnMgr` ### `ConnMgr`
Connection manager configuration.
The connection manager determines which and how many connections to keep and can be configured to keep.
- `Type` - `Type`
Sets the type of connection manager to use, options are: `"none"` and `"basic"`. Sets the type of connection manager to use, options are: `"none"` (no connection management) and `"basic"`.
#### Basic Connection Manager
- `LowWater` - `LowWater`
LowWater is the minimum number of connections to maintain. LowWater is the minimum number of connections to maintain.
- `HighWater` - `HighWater`
HighWater is the number of connections that, when exceeded, will trigger a connection GC operation. HighWater is the number of connections that, when exceeded, will trigger a connection GC operation.
- `GracePeriod` - `GracePeriod`
GracePeriod is a time duration that new connections are immune from being closed by the connection manager. GracePeriod is a time duration that new connections are immune from being closed by the connection manager.
The "basic" connection manager tries to keep between `LowWater` and `HighWater` connections. It works by:
1. Keeping all connections until `HighWater` connections is reached.
2. Once `HighWater` is reached, it closes connections until `LowWater` is reached.
3. To prevent thrashing, it never closes connections established within the `GracePeriod`.
**Example:**
```json
{
"Swarm": {
"ConnMgr": {
"Type": "basic",
"LowWater": 100,
"HighWater": 200,
"GracePeriod": "30s"
}
}
}
```
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论