Hacker News new | ask | show | jobs
by nextaccountic 904 days 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

2 comments

That’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()!
Yeah, setting a hard cap on the maximum cpu count doesn’t feel right? Why not depend on the available cores?
It’s a safe choice. Some systems won’t report cores correctly which can lead to reallllllly bad performance.
Maybe make it min(8, available_cores()) or something like that