Skip to content

Commit

Permalink
Merge pull request #5839 from ipfs/doc/connmgr
Browse files Browse the repository at this point in the history
config: document the connection manager
  • Loading branch information
Stebalien authored Dec 12, 2018
2 parents cb57105 + 716f69b commit 451f7b3
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

## `Swarm`

Options for configuring the swarm.

- `AddrFilters`
Expand All @@ -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.

### `ConnMgr`
Connection manager configuration.

The connection manager determines which and how many connections to keep and can be configured to keep.

- `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 is the minimum number of connections to maintain.

- `HighWater`
HighWater is the number of connections that, when exceeded, will trigger a connection GC operation.

- `GracePeriod`
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"
}
}
}
```

0 comments on commit 451f7b3

Please sign in to comment.