From: "moznion (Taiki Kawakami) via ruby-core" Date: 2025-12-19T08:12:16+00:00 Subject: [ruby-core:124315] [Ruby Feature#21797] Make Etc.nprocessors cgroup-aware on Linux Issue #21797 has been reported by moznion (Taiki Kawakami). ---------------------------------------- Feature #21797: Make Etc.nprocessors cgroup-aware on Linux https://bugs.ruby-lang.org/issues/21797 * Author: moznion (Taiki Kawakami) * Status: Open ---------------------------------------- Currently, `Etc.nprocessors` ignores cgroup CPU quotas. This causes issues in containers where CPU limits differ from the host CPU count. I have written a gem for this purpose (https://github.com/moznion/maxprocs-ruby), but it would be preferable if the Ruby core implementation respected cgroup configuration. Additionally, concurrent-ruby provides similar functionality, but if the language itself offered this capability, language users would not need to implement it individually. Extending `Etc.nprocessors` to respect cgroups is one option, but that would be a breaking change, so adding a new API might be a better approach. ## Prior Art - Go 1.25: runtime GOMAXPROCS (Issue [#73193](https://github.com/golang/go/issues/73193)) - [uber-go/automaxprocs](https://github.com/uber-go/automaxprocs) - [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby): https://github.com/ruby-concurrency/concurrent-ruby/blob/129cf004294af68ac53e53a2f1197621b303570a/lib/concurrent-ruby/concurrent/utility/processor_counter.rb -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/