From 295fd96bd0ce9afac62ab5afb5b775a5702258aa Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 20 Dec 2024 00:48:21 +0100 Subject: [PATCH] docs: clarify Swarm.ResourceMgr.MaxMemory (#10622) related to ux problem described in #10621 --- docs/config.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index db305e40977..8fbcc849449 100644 --- a/docs/config.md +++ b/docs/config.md @@ -2119,7 +2119,8 @@ Type: `flag` #### `Swarm.ResourceMgr.MaxMemory` -This is the max amount of memory to allow libp2p to use. +This is the max amount of memory to allow go-libp2p to use. + libp2p's resource manager will prevent additional resource creation while this limit is reached. This value is also used to scale the limit on various resources at various scopes when the default limits (discussed in [libp2p resource management](./libp2p-resource-management.md)) are used. @@ -2127,6 +2128,11 @@ For example, increasing this value will increase the default limit for incoming It is possible to inspect the runtime limits via `ipfs swarm resources --help`. +> [!IMPORTANT] +> `Swarm.ResourceMgr.MaxMemory` is the memory limit for go-libp2p networking stack alone, and not for entire Kubo or Bitswap. +> +> To set memory limit for the entire Kubo process, use [`GOMEMLIMIT` environment variable](http://web.archive.org/web/20240222201412/https://kupczynski.info/posts/go-container-aware/) which all Go programs recognize, and then set `Swarm.ResourceMgr.MaxMemory` to less than your custom `GOMEMLIMIT`. + Default: `[TOTAL_SYSTEM_MEMORY]/2` Type: `optionalBytes`