A Go service on Kubernetes gets throttled when GOMAXPROCS ignores the pod's CPU limit, and OOM-killed when it runs without GOMEMLIMIT. The other recipes cover leaked connections and leaked goroutines. Start with GOMAXPROCS and GOMEMLIMIT for Go on Kubernetes.
- GOMAXPROCS and GOMEMLIMIT for Go on Kubernetes
Match GOMAXPROCS to the pod's CPU limit and set GOMEMLIMIT just under its memory limit, so a Go service stops getting throttled and OOM-killed at peak.
- Go Too Many Open Files and HTTP Connection Reuse
Share one Go HTTP client per service and set server timeouts, so peak traffic stops leaking file descriptors and your service keeps accepting connections.
- Find a Goroutine Leak with pprof and Prometheus
Alert on a rising goroutine floor and read the golang pprof goroutine profiles, so you find a goroutine leak days before it ends in an OOM kill.