{"id":13461423,"url":"https://github.com/uber-go/automaxprocs","last_synced_at":"2025-05-14T10:11:49.198Z","repository":{"id":37430938,"uuid":"90336564","full_name":"uber-go/automaxprocs","owner":"uber-go","description":"Automatically set GOMAXPROCS to match Linux container CPU quota.","archived":false,"fork":false,"pushed_at":"2024-09-23T17:49:02.000Z","size":96,"stargazers_count":4359,"open_issues_count":17,"forks_count":165,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-02T00:18:42.501Z","etag":null,"topics":["container","cpu","go","golang","gomaxprocs"],"latest_commit_sha":null,"homepage":"https://godoc.org/go.uber.org/automaxprocs","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uber-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-05T04:21:40.000Z","updated_at":"2025-03-31T09:35:32.000Z","dependencies_parsed_at":"2023-02-08T08:16:01.201Z","dependency_job_id":"6d50e69a-a4bd-4567-9c2e-2f55fe911203","html_url":"https://github.com/uber-go/automaxprocs","commit_stats":{"total_commits":73,"total_committers":30,"mean_commits":2.433333333333333,"dds":0.7397260273972603,"last_synced_commit":"8553d3bb214968c2be2cf9052880164cdf4fc2f8"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber-go%2Fautomaxprocs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber-go%2Fautomaxprocs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber-go%2Fautomaxprocs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber-go%2Fautomaxprocs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uber-go","download_url":"https://codeload.github.com/uber-go/automaxprocs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247954081,"owners_count":21024155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","cpu","go","golang","gomaxprocs"],"created_at":"2024-07-31T11:00:38.607Z","updated_at":"2025-04-09T01:23:49.059Z","avatar_url":"https://github.com/uber-go.png","language":"Go","funding_links":[],"categories":["Misc","Go","开源类库","Backend Go","Open source library","语音识别与合成_其他","Repositories"],"sub_categories":["开发辅助包","Utility","Development Aid Package","资源传输下载"],"readme":"# automaxprocs [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]\n\nAutomatically set `GOMAXPROCS` to match Linux container CPU quota.\n\n## Installation\n\n`go get -u go.uber.org/automaxprocs`\n\n## Quick Start\n\n```go\nimport _ \"go.uber.org/automaxprocs\"\n\nfunc main() {\n  // Your application logic here.\n}\n```\n\n# Performance\nData measured from Uber's internal load balancer. We ran the load balancer with 200% CPU quota (i.e., 2 cores):\n\n| GOMAXPROCS         |  RPS      | P50 (ms) | P99.9 (ms) |\n| ------------------ | --------- | -------- | ---------- |\n| 1                  | 28,893.18 | 1.46     | 19.70      |\n| 2 (equal to quota) | 44,715.07 | 0.84     | 26.38      |\n| 3                  | 44,212.93 | 0.66     | 30.07      |\n| 4                  | 41,071.15 | 0.57     | 42.94      |\n| 8                  | 33,111.69 | 0.43     | 64.32      |\n| Default (24)       | 22,191.40 | 0.45     | 76.19      |\n\nWhen `GOMAXPROCS` is increased above the CPU quota, we see P50 decrease slightly, but see significant increases to P99. We also see that the total RPS handled also decreases.\n\nWhen `GOMAXPROCS` is higher than the CPU quota allocated, we also saw significant throttling:\n\n```\n$ cat /sys/fs/cgroup/cpu,cpuacct/system.slice/[...]/cpu.stat\nnr_periods 42227334\nnr_throttled 131923\nthrottled_time 88613212216618\n```\n\nOnce `GOMAXPROCS` was reduced to match the CPU quota, we saw no CPU throttling.\n\n## Development Status: Stable\n\nAll APIs are finalized, and no breaking changes will be made in the 1.x series\nof releases. Users of semver-aware dependency management systems should pin\nautomaxprocs to `^1`.\n\n## Contributing\n\nWe encourage and support an active, healthy community of contributors \u0026mdash;\nincluding you! Details are in the [contribution guide](CONTRIBUTING.md) and\nthe [code of conduct](CODE_OF_CONDUCT.md). The automaxprocs maintainers keep\nan eye on issues and pull requests, but you can also report any negative\nconduct to oss-conduct@uber.com. That email list is a private, safe space;\neven the automaxprocs maintainers don't have access, so don't hesitate to hold\nus to a high standard.\n\n\u003chr\u003e\n\nReleased under the [MIT License](LICENSE).\n\n[doc-img]: https://godoc.org/go.uber.org/automaxprocs?status.svg\n[doc]: https://godoc.org/go.uber.org/automaxprocs\n[ci-img]: https://github.com/uber-go/automaxprocs/actions/workflows/go.yml/badge.svg\n[ci]: https://github.com/uber-go/automaxprocs/actions/workflows/go.yml\n[cov-img]: https://codecov.io/gh/uber-go/automaxprocs/branch/master/graph/badge.svg\n[cov]: https://codecov.io/gh/uber-go/automaxprocs\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber-go%2Fautomaxprocs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuber-go%2Fautomaxprocs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber-go%2Fautomaxprocs/lists"}