aiomultiprocess
aiomultiprocess copied to clipboard
fix cpu_count is NOT correct under container environment! #110
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
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.