docs: Swarm.ResourceMgr.Limits
Marcin Rataj committed
Apr 28, 2022 at 20:13 UTC
cab69276e9af76c5e1c9cb8b19930b8c5d1b32fa
1 file changed
+8
-11
docs/config.md
+8
-11
@@ -131,6 +131,7 @@ config file at runtime.
131
- [`Swarm.ConnMgr.GracePeriod`](#swarmconnmgrgraceperiod)
132
- [`Swarm.ResourceMgr`](#swarmresourcemgr)
133
- [`Swarm.ResourceMgr.Enabled`](#swarmresourcemgrenabled)
134
+ - [`Swarm.ResourceMgr.Limits`](#swarmresourcemgrlimits)
135
- [`Swarm.Transports`](#swarmtransports)
136
- [`Swarm.Transports.Network`](#swarmtransportsnetwork)
137
- [`Swarm.Transports.Network.TCP`](#swarmtransportsnetworktcp)
@@ -1641,14 +1642,12 @@ Default: `false`
1642
1643
Type: `flag`
1644
1644
-<!-- TODO: config compatible with the output of 'swarm limit' - see https://github.com/ipfs/go-ipfs/issues/8858
1645
-
1645
#### `Swarm.ResourceMgr.Limits`
1646
1647
Map of resource limits [per scope](https://github.com/libp2p/go-libp2p-resource-manager#resource-scopes).
1648
1650
-The format follows [`limit.json`](https://github.com/libp2p/go-libp2p-resource-manager/blob/v0.1.5/limit_config.go#L165)
1651
-struct from go-libp2p-resource-manager@v0.1.5
1649
+The map supports fields from [`BasicLimiterConfig`](https://github.com/libp2p/go-libp2p-resource-manager/blob/v0.3.0/limit_config.go#L165-L185)
1650
+struct from [go-libp2p-resource-manager](https://github.com/libp2p/go-libp2p-resource-manager#readme).
1651
1652
Example:
1653
@@ -1674,18 +1673,16 @@ Example:
1673
}
1674
```
1675
1677
-Current resource usage and a list of services, protocols, and peers can be obtained via
1678
-`ipfs swarm stats --help`
1676
+Current resource usage and a list of services, protocols, and peers can be
1677
+obtained via `ipfs swarm stats --help`
1678
1680
-It is also possible to adjust runtime limits via `ipfs stats limit --help`.
1681
-By default changes are ephemeral (config remains intact), and won't be applied
1682
-after reboot. To persist them here, pass `limit -s`.
1679
+It is also possible to adjust some runtime limits via `ipfs stats limit --help`.
1680
+Changes made via `stats limit` are persisted in `Swarm.ResourceMgr.Limits`.
1681
1684
-Default: `{}` (empty == implicit defaults from go-libp2p)
1682
+Default: `{}` (use the safe implicit defaults)
1683
1684
Type: `object[string->object]`
1685
1688
--->
1686
1687
### `Swarm.Transports`
1688