Consider using `Concurrent.available_processor_count` to set default threads count
pjurewicz opened this issue · 0 comments
pjurewicz commented
In the containerized environment, calling Concurrent.processor_count gives us host machine processor count.
The proper question to ask is how many CPU cores are usable and now we can do that by calling Integer(Concurrent.available_processor_count)
.
It would require sticking to the 'concurrent-ruby', '>= 1.3.1'
.
It should help avoid exceeding database connection pools and slowing down job execution time for many people using K8s.