config: document the connection manager
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Dec 11, 2018 at 18:59 UTC
716f69b8f8a3abbaa2fdcacc7827eba00e3470de
1 file changed
+29
-2
docs/config.md
+29
-2
@@ -311,6 +311,7 @@ Tells reprovider what should be announced. Valid strategies are:
311
- "roots" - only announce directly pinned keys and root keys of recursive pins
312
313
## `Swarm`
314
+
315
Options for configuring the swarm.
316
317
- `AddrFilters`
@@ -334,15 +335,41 @@ Enables HOP relay for the node. If this is enabled, the node will act as
335
an intermediate (Hop Relay) node in relay circuits for connected peers.
336
337
### `ConnMgr`
337
-Connection manager configuration.
338
+
339
+The connection manager determines which and how many connections to keep and can be configured to keep.
340
341
- `Type`
340
-Sets the type of connection manager to use, options are: `"none"` and `"basic"`.
342
+Sets the type of connection manager to use, options are: `"none"` (no connection management) and `"basic"`.
343
+
344
+#### Basic Connection Manager
345
346
- `LowWater`
347
LowWater is the minimum number of connections to maintain.
348
349
- `HighWater`
350
HighWater is the number of connections that, when exceeded, will trigger a connection GC operation.
351
+
352
- `GracePeriod`
353
GracePeriod is a time duration that new connections are immune from being closed by the connection manager.
354
+
355
+The "basic" connection manager tries to keep between `LowWater` and `HighWater` connections. It works by:
356
+
357
+1. Keeping all connections until `HighWater` connections is reached.
358
+2. Once `HighWater` is reached, it closes connections until `LowWater` is reached.
359
+3. To prevent thrashing, it never closes connections established within the `GracePeriod`.
360
+
361
+**Example:**
362
+
363
+
364
+```json
365
+{
366
+ "Swarm": {
367
+ "ConnMgr": {
368
+ "Type": "basic",
369
+ "LowWater": 100,
370
+ "HighWater": 200,
371
+ "GracePeriod": "30s"
372
+ }
373
+ }
374
+}
375
+```