mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
88c01e659c
This PR reverts the change in #8696 where automaxprocs was removed. This meant the go language default of 2 procs vs 1 was used. In some memory constrained deployments of OPA, this caused OOM issues where the server used more memory than before with 2 processes running. This PR restores the automaxprocs dependency and this behaviour. This PR also follows other data-heavy CNCF projects in pairing this with automemlimit to automate the setting of GOMEMLIMIT based on the cgroup data too. This makes no change for users manually setting these, but hopefully will provide some sensible defaults that work well for most cases, and better than the Go defaults in low resource deployments. <details> <summary>Other projects</summary> * https://github.com/prometheus/prometheus/blob/2ad3a871701531d1485f678acb7523cd0aa31789/go.mod#L11 * https://github.com/istio/istio/blob/4985ae369245dcc91bc107a0c47ea41ded0c1a12/go.mod#L8 * https://github.com/grafana/alloy/blob/e11d0f03e2b2e727161fb2169cade54698e17bd8/go.mod#L19 * https://github.com/thanos-io/thanos/blob/main/go.mod#L9 * https://github.com/kubernetes/kube-state-metrics/blob/main/go.mod#L6 * https://github.com/authzed/spicedb/blob/main/go.mod#L22 </details> --------- Signed-off-by: Charlie Egan <charlie_egan@apple.com>
Documentation and Website Development
Please see the contributing documentation for information about how to get started contributing to the OPA documentation and website.