uber-go/automaxprocs

Automatically set GOMAXPROCS to match Linux container CPU quota.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 40 minutes ago
Added to GitGenius on September 14th, 2026
Created on May 5th, 2017
Open Issues & Pull Requests: 21 (+0)
GitHub issues: Enabled
Number of forks: 175
Total Stargazers: 4,851 (+0)
Total Subscribers: 35 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.9 days
Mean response time: 103.2 days
90th percentile: 327.8 days
Tracked items: 10

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 9
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 861 days
Stale 30+ days: 9
Stale 90+ days: 9

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

automaxprocs is a Go library that automatically sets GOMAXPROCS to match Linux container CPU quota.

The problem it solves is that Go's default GOMAXPROCS behavior does not account for container CPU limits, causing the runtime to spawn more OS threads than the container can actually use. This leads to excessive context switching, CPU throttling, and degraded performance. automaxprocs detects the CPU quota imposed by the container's cgroup and adjusts GOMAXPROCS accordingly, eliminating throttling and improving throughput and latency.

Projects running Go services in containerized environments should adopt this tool, particularly those deployed on Kubernetes or other container orchestration platforms where CPU quotas are common. It is especially valuable for latency-sensitive workloads where P99 tail latencies matter. The library requires only a single import and function call to activate, making integration straightforward. Performance data from production load balancers shows that matching GOMAXPROCS to the CPU quota significantly improves request throughput and reduces tail latencies compared to Go's default behavior.

The project is stable with finalized APIs and a commitment to semantic versioning. Maintenance activity shows consistent attention to issues and pull requests, with established contribution guidelines and a code of conduct enforced through a dedicated reporting channel.