@jake@mastodon.theorangeone.net
Post #2167951
2026-05-05 19:58 UTC
@itamarst I thought the point of `os.process_cpu_count()` was that it's aware of external limits on the process?
https://docs.python.org/3/library/os.html#os.process_cpu_count
Replies (1)
-
@itamarst@hachyderm.io 2026-05-05 20:38
@jake It's aware of CPU affinity. It is _not_ aware of cgroups. ``` $ docker run -it --cpus=3 python:3.14-slim python -c "import os; print(os.process_cpu_count())" 20 ``` Should have printed 3 if it was cgroups-aware.