Skip to content

Commit cab6927

Browse files
lidelaschmahmann
authored andcommitted
docs: Swarm.ResourceMgr.Limits
1 parent 126ebc4 commit cab6927

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

docs/config.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ config file at runtime.
131131
- [`Swarm.ConnMgr.GracePeriod`](#swarmconnmgrgraceperiod)
132132
- [`Swarm.ResourceMgr`](#swarmresourcemgr)
133133
- [`Swarm.ResourceMgr.Enabled`](#swarmresourcemgrenabled)
134+
- [`Swarm.ResourceMgr.Limits`](#swarmresourcemgrlimits)
134135
- [`Swarm.Transports`](#swarmtransports)
135136
- [`Swarm.Transports.Network`](#swarmtransportsnetwork)
136137
- [`Swarm.Transports.Network.TCP`](#swarmtransportsnetworktcp)
@@ -1641,14 +1642,12 @@ Default: `false`
16411642

16421643
Type: `flag`
16431644

1644-
<!-- TODO: config compatible with the output of 'swarm limit' - see https://github.com/ipfs/go-ipfs/issues/8858
1645-
16461645
#### `Swarm.ResourceMgr.Limits`
16471646

16481647
Map of resource limits [per scope](https://github.com/libp2p/go-libp2p-resource-manager#resource-scopes).
16491648

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).
16521651

16531652
Example:
16541653

@@ -1674,18 +1673,16 @@ Example:
16741673
}
16751674
```
16761675

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`
16791678

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`.
16831681

1684-
Default: `{}` (empty == implicit defaults from go-libp2p)
1682+
Default: `{}` (use the safe implicit defaults)
16851683

16861684
Type: `object[string->object]`
16871685

1688-
-->
16891686

16901687
### `Swarm.Transports`
16911688

0 commit comments

Comments
 (0)