> What would be the value of nprocessor in this case?, e.g. if cpu_quotais 0.5, what does nprocessors return? cpu_quota.ceil? I think it depends on the decision, but either floor or ceil should be fine (for reference, Go’s `GOMAXPROCS...moznion (Taiki Kawakami)
Thank you for your comments. Let me summarize the discussion. ### 1. Introducing a new API under `Etc` Introducing a method such as `Etc.cpu_quota`, which returns `Float | nil`, seems reasonable. ### 2. Changing the behavior of ...moznion (Taiki Kawakami)
osyoyu (Daisuke Aritomo) wrote in #note-4: > It'd be nice if `RUBY_MAX_CPU` would be autoconfigured based on this, just like Go 1.25 `GOMAXPROCS`. > ... This sounds very good, but it should probably be a separate ticket though. nobu...moznion (Taiki Kawakami)
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 ...moznion (Taiki Kawakami)