Files
releases/docs
Charlie Egan 88c01e659c runtime: Restore goautomaxprocs, add automemlimit (#8784)
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>
2026-06-15 13:54:43 +00:00
..
2026-06-10 10:13:01 +01:00

Documentation and Website Development

Please see the contributing documentation for information about how to get started contributing to the OPA documentation and website.