# uber-go/automaxprocs

Automatically set GOMAXPROCS to match Linux container CPU quota.

Repository: https://github.com/uber-go/automaxprocs
Canonical: https://ross.abutalabs.com/products/automaxprocs
Homepage: https://godoc.org/go.uber.org/automaxprocs
Language: Go
License: MIT
License Family: permissive
Topics: go, golang, gomaxprocs, container, cpu
Last push: 2025-11-02T04:44:49+00:00

## Health v2 (maintenance only)
Score: 45/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 50, release rhythm 8, longevity 100
- inputs: {"age_days": 3407, "days_push": 304, "days_rel": 709, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4847, forks 176 (observed 2026-08-28T04:09:01.352560+00:00)

## What it is
A Go library that automatically sets GOMAXPROCS to match the Linux container CPU quota (cgroup limits). It is imported for side effects with a single blank import and eliminates CPU throttling and tail-latency issues in containerized Go services.

## Use cases
- fix high p99 latency in Go services running in Kubernetes
- stop CPU throttling for containerized Go apps
- automatically set GOMAXPROCS to match cgroup CPU quota
- tune Go runtime for containers with CPU limits
- reduce tail latency in Go microservices under CPU quotas
- optimize Go app performance in Docker with CPU limits

## When to choose
- your Go service runs in containers (Docker/Kubernetes) with CPU limits
- you see CPU throttling or high tail latency in cgroup cpu.stat
- you want a zero-code, drop-in runtime fix via a blank import

## When to avoid
- your Go programs run on bare metal or VMs without cgroup CPU quotas
- you run Go 1.25+ where the runtime already respects container CPU limits
- you need fine-grained manual control over GOMAXPROCS

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, configuration-management, developer-tools
- domain: performance, cloud-computing, developer-tools
- platform: go
- tags: gomaxprocs, cgroup, cpu-quota, runtime-tuning, go-library, containers, linux, docker, kubernetes

## Member repositories
- uber-go/automaxprocs (main) score 45

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:01.352560+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:18:26.420472+00:00, confidence not recorded.
  - readme: https://github.com/uber-go/automaxprocs (fetched 2026-08-28T04:09:01.352560+00:00, sha dfb0e9ce9b01)
  - homepage: https://godoc.org/go.uber.org/automaxprocs (fetched 2026-08-29T09:01:06.008891+00:00, sha 313694197ba2)
  - site_page: https://pkg.go.dev/about (fetched 2026-08-29T09:01:06.020027+00:00, sha 757852027879)
  - site_page: https://pkg.go.dev/go.uber.org/automaxprocs (fetched 2026-08-29T09:01:06.018103+00:00, sha fb6e47403bd2)
  - site_page: https://go.dev/project (fetched 2026-08-29T09:01:06.022008+00:00, sha d5ca00bb378b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
