Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support python -Xcpu_count=<n> feature for container environment. #109595

Closed
Assignees
corona10
Labels
3.13bugs and security fixestype-featureA feature request or enhancement
@corona10

Description

@corona10

Feature or enhancement

As#80235, there are requests for isolating CPU count in k8s or container environment, andthis 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)

There were a lot of discussions, and following the cgroup spec requires a lot of complexity and performance issues (due to fallback).
JDK 21 chooses not to depend on CPU Shares to compute active processor count and they choose to use-XX:ActiveProcessorCount=<n>.
see:https://bugs.openjdk.org/browse/JDK-8281571

I think that this strategy will be worth using from the CPython side too.
So if the user executes the python with-Xcpu_count=3optionos.cpu_count will return 3, instead of the actual CPU count that was calculated fromos.cpu_count.

cc@vstinner@indygreg

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixestype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp