-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Checklist
- My issue is specific & actionable.
- I am not suggesting a protocol enhancement.
- I have searched on the issue tracker for my issue.
Description
In addition to the upcoming Resource Manager, as of version 1.19, Golang has a built-in soft memory limit option, which tunes how the garbage collector operates within memory-constrained environments. This option can be set either using the GOMEMLIMIT
environment varibale or by using SetMemoryLimit
in the runtime/debug
package.
The current default configuration of kubo under high load tends to eat all the memory it can gets until it gets until killed by the OOM, causing frequent restarts of nodes and loss of connections and service.
The new resource manager should be able to address some of these issues. However, documenting and testing Go's native soft memory limits could still significantly improve performance and/or memory usage, particularly under memory-constrained environments:
- In addition to the resource manager's decisions on runtime usage, the limit-aware GC would collaborate to have more memory available for the kubo runtime.
- Until the resource manager is enabled by default, it could already increase stability and performance.
Note that 2. is written as could. Hence, my request is as follows:
- Perform manual tests (with and/or without resource manager) with Golang's soft memory limit set and evaluate results.
- Document results as recommendations for production-scale IPFS deployments.
- If aforementioned recommendation is positive, add automated testing.
- Possibly, call
SetMemoryLimit
when a memory limit is configured in the resource manager.