spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Set debug.SetMemoryLimit based on Kubernetes environment

Open jakedt opened this issue 2 years ago • 1 comments

SpiceDB often runs in memory constrained environments. We should set the soft memory limit based on how much memory the container that we're running in has.

https://pkg.go.dev/runtime/debug@master#SetMemoryLimit

jakedt avatar Sep 13 '22 19:09 jakedt

Searched GitHub to see how folks were using this, to try and see if there was a library that looked into cgroups and called this function. I did not find anything that accomplished that, but I did discover how TiDB is tuning the runtime with that call: https://pkg.go.dev/github.com/pingcap/tidb/util/gctuner?utm_source=godoc

jzelinskie avatar Oct 18 '22 20:10 jzelinskie

We can close this now that we are using GOMEMLIMIT

vroldanbet avatar Jul 05 '24 12:07 vroldanbet