I wanted to manage the number of parallel processing executions in the development of ruby on rails, but it didn't work, so I will talk about the cause.
Sidekiq-limit_fetch is a gem for managing the number of parallel processing executions in sidekiq.
https://github.com/brainopia/sidekiq-limit_fetch
Gemfile
gem 'sidekiq-limit_fetch'
sidekiq.yml
:queues:
- queue1
- queue2
:limits:
queue1: 2
queue2: 5
In the above case, queue1 has 2 parallel executions and queue2 has 5 parallel executions.
As mentioned above, the number of parallel executions exceeds the specified number even though the gem of sidekiq-limit_fetch is used.
The cause of this was overriding the limit setting function by other gems.
Gemfile
gem 'serverspec'
Due to the above gem, the set function described in Sidekiq-limit_fetch was not processed normally. serverspec is a gem for automating server testing. So by removing the serverspec from the Gemfile, sidekiq-limit_fetch will do the job for you.
However, since the phenomenon that the number of parallel executions rarely exceeded continued to occur, I found it safer to write the code that manages the number of job executions by myself.
Recommended Posts