Skip to content

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

Open
eastonsuo wants to merge 1 commit into
omnilib:mainfrom
eastonsuo:main
Open

fix cpu_count is NOT correct under container environment! #110#111
eastonsuo wants to merge 1 commit into
omnilib:mainfrom
eastonsuo:main

Conversation

@eastonsuo

Copy link
Copy Markdown

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

amyreese commented Oct 2, 2021

Copy link
Copy Markdown
Member

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