Title: Support python -Xcpu_count=
Open Graph Title: Support python -Xcpu_count=
X Title: Support python -Xcpu_count=
Description: Feature or enhancement As #80235, there are requests for isolating CPU count in k8s or container environment, and this is a very important feature these days. (Practically my corp, a lot of workloads are running under container environme...
Open Graph Description: Feature or enhancement As #80235, there are requests for isolating CPU count in k8s or container environment, and this is a very important feature these days. (Practically my corp, a lot of workloa...
X Description: Feature or enhancement As #80235, there are requests for isolating CPU count in k8s or container environment, and this is a very important feature these days. (Practically my corp, a lot of workloa...
Opengraph URL: https://github.com/python/cpython/issues/109595
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support python -Xcpu_count=\u003cn> feature for container environment.","articleBody":"# Feature or enhancement\r\n\r\nAs https://github.com/python/cpython/issues/80235, there are requests for isolating CPU count in k8s or container environment, and **this is a very important feature these days**. (Practically my corp, a lot of workloads are running under container environments, and controlling CPU count is very important to resolve busy neighborhood issues)\r\n\r\nThere were a lot of discussions, and following the cgroup spec requires a lot of complexity and performance issues (due to fallback).\r\nJDK 21 chooses not to depend on CPU Shares to compute active processor count and they choose to use `-XX:ActiveProcessorCount=\u003cn>`.\r\nsee: https://bugs.openjdk.org/browse/JDK-8281571\r\n\r\nI think that this strategy will be worth using from the CPython side too.\r\nSo if the user executes the python with `-Xcpu_count=3`option `os.cpu_count` will return 3, instead of the actual CPU count that was calculated from `os.cpu_count`.\r\n\r\ncc @vstinner @indygreg \n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-109667\n* gh-110639\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/corona10","@type":"Person","name":"corona10"},"datePublished":"2023-09-20T01:51:43Z","url":"https://github.com/python/cpython/issues/109595"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fd1214b1-0680-ff34-8e08-e50251de5f24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D83C:28264A:7B238D:A2BB39:6B0253D6 |
| html-safe-nonce | 1b85bbe2ed138e46d04bc506f9fee36c6802f0b9de511b62e165359868609e73 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODNDOjI4MjY0QTo3QjIzOEQ6QTJCQjM5OjZCMDI1M0Q2IiwidmlzaXRvcl9pZCI6IjEyNDkzNDY0NjU4OTI0NTAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0238d91d359cf2ca9d7b07acc47cfe0728468e3197a5500f0eb7ea84e0c221a4 |
| hovercard-subject-tag | issue:1903947108 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/109595/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86f94e6028981df6d69ab76adc129b4b80728813ed920c2371f1ad1c5bd56a33/python/cpython/issues/109595 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86f94e6028981df6d69ab76adc129b4b80728813ed920c2371f1ad1c5bd56a33/python/cpython/issues/109595 |
| og:image:alt | Feature or enhancement As #80235, there are requests for isolating CPU count in k8s or container environment, and this is a very important feature these days. (Practically my corp, a lot of workloa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | corona10 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width