helio icon indicating copy to clipboard operation
helio copied to clipboard

Missing cgroups support

Open rofafor opened this issue 1 year ago • 1 comments

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

rofafor avatar Mar 30 '24 08:03 rofafor

wanna send a PR?

romange avatar Apr 08 '24 10:04 romange