mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Verify connection pool sizing, fixes #3917
This commit is contained in:
parent
03e63b8c99
commit
b1bdaa7859
3 changed files with 8 additions and 1 deletions
|
@ -6,6 +6,7 @@ HEAD
|
|||
-----------
|
||||
|
||||
- **Decrease default concurrency from 25 to 10** [#3892]
|
||||
- Verify connection pool sizing upon startup [#3917]
|
||||
- Smoother scheduling for large Sidekiq clusters [#3889]
|
||||
- Switch Sidekiq::Testing impl from alias\_method to Module#prepend, for resiliency [#3852]
|
||||
- Update Sidekiq APIs to use SCAN for scalability [#3848, ffiller]
|
||||
|
|
|
@ -80,6 +80,12 @@ module Sidekiq
|
|||
ver = Sidekiq.redis_info['redis_version']
|
||||
raise "You are using Redis v#{ver}, Sidekiq requires Redis v2.8.0 or greater" if ver < '2.8'
|
||||
|
||||
# Since the user can pass us a connection pool explicitly in the initializer, we
|
||||
# need to verify the size is large enough or else Sidekiq's performance is dramatically slowed.
|
||||
cursize = Sidekiq.redis_pool.size
|
||||
needed = Sidekiq.options[:concurrency] + 2
|
||||
raise "Your pool of #{cursize} Redis connections is too small, please increase the size to at least #{needed}" if cursize < needed
|
||||
|
||||
# cache process identity
|
||||
Sidekiq.options[:identity] = identity
|
||||
|
||||
|
|
|
@ -18,6 +18,6 @@ Gem::Specification.new do |gem|
|
|||
gem.required_ruby_version = ">= 2.2.2"
|
||||
|
||||
gem.add_dependency 'redis', '>= 3.3.5', '< 5'
|
||||
gem.add_dependency 'connection_pool', '~> 2.2', '>= 2.2.0'
|
||||
gem.add_dependency 'connection_pool', '~> 2.2', '>= 2.2.2'
|
||||
gem.add_dependency 'rack-protection', '>= 1.5.0'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue