3 ms·
> RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8. Shouldn't the default be the number
by nextaccountic 3y ago
> RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8.
Shouldn't the default be the number of logical cores? Like Rust's Tokio and countless other M:N runtimes
- MoOmer 3y agoThat’s an optimization that can be added later, with some nuance. IIRC Go had a similar situation for years; I remember setting GO_MAX_PROCS in my init() or main()!
- Alifatisk 3y agoYeah, setting a hard cap on the maximum cpu count doesn’t feel right? Why not depend on the available cores?
- SkyPuncher 3y agoIt’s a safe choice. Some systems won’t report cores correctly which can lead to reallllllly bad performance.
- nextaccountic 3y agoMaybe make it min(8, available_cores()) or something like that