Open rofafor opened 8 months ago
The current CPU count detector in Linux only uses affinity: https://github.com/romange/helio/blob/ceaa6f844b2a72e03c1535939d21aa3fbd3c4e98/util/fibers/proactor_pool.cc#L39-L44
Modern containerized systems require use of cgroups that is used to limit resource usage and therefore it should be taken account also in Helio's CPU detection. Please, take a look at e.g. OpenJDK's implementation: https://github.com/openjdk/jdk/blob/37c2279148fa91627137e3af362bfcffde61acd0/src/hotspot/os/linux/cgroupSubsystem_linux.cpp#L449-L513
wanna send a PR?
The current CPU count detector in Linux only uses affinity: https://github.com/romange/helio/blob/ceaa6f844b2a72e03c1535939d21aa3fbd3c4e98/util/fibers/proactor_pool.cc#L39-L44
Modern containerized systems require use of cgroups that is used to limit resource usage and therefore it should be taken account also in Helio's CPU detection. Please, take a look at e.g. OpenJDK's implementation: https://github.com/openjdk/jdk/blob/37c2279148fa91627137e3af362bfcffde61acd0/src/hotspot/os/linux/cgroupSubsystem_linux.cpp#L449-L513