Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cpu_count is NOT correct under container environment! #110 #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eastonsuo
Copy link

Description

when under container environment, os.cpu_count() get the host cpu count, which may be too large for the container to use.

Fixes:
use cgroup to compute the virtual cpu the container use

@amyreese
Copy link
Member

amyreese commented Oct 2, 2021

There's a lot of system-specific paths and configuration here that I'd rather not have to maintain. This really feels like it should belong in a separate package on PyPI that aiomultiprocess can just use to get an appropriate cpu count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants