Swarm.ResourceMgr.MaxMemory vs GOMEMLIMIT #10621
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
Checklist
Installation method
dist.ipfs.tech or ipfs-update
Version
Config
https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgrmaxmemory
Description
Problem
Swarm.ResourceMgr.MaxMemory
is often interpreted and used as "memory limit for Kubo", while it is only passed to go-libp2p and used for limited set of things (transports, but not bitswap).Ref. https://github.com/libp2p/go-libp2p/tree/master/p2p/host/resource-manager#readme
The default
Swarm.ResourceMgr.MaxMemory
is dynamic and conservative:The actual memory limit people want to set is for entire Kubo, and that is likely
GOMEMLIMIT
but we do not set it by default.This means:
Swarm.ResourceMgr.MaxMemory
are still getting OOM, because it does not cover all the basesSolution brainstorm
Swarm.ResourceMgr.MaxMemory
.[TOTAL_SYSTEM_MEMORY]*0.75
?GOMEMLIMIT
if is present in env, it should always take precedence, and implicit default forSwarm.ResourceMgr.MaxMemory
should be calculated from that ceiling.Swarm.ResourceMgr.MaxMemory
higher than implicit (or explicit)GOMEMLIMIT
memory
in config and only findingResourceMgr.MaxMemory
Limits.MaxMemory
? Or genericEnv.*
and support settingEnv.GOMEMLIMIT
via config?cc @sukunrt @ipfs/kubo-maintainers for feedback / ideas.
The text was updated successfully, but these errors were encountered: