aws / aws-sdk-rails

Official repository for the aws-sdk-rails gem, which integrates the AWS SDK for Ruby with Ruby on Rails.
Other
596 stars 62 forks source link

Consider using `Concurrent.available_processor_count` to set default threads count #125

Closed pjurewicz closed 5 months ago

pjurewicz commented 5 months ago

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.