Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq: Pass count through to yml file generator #452

Open
wants to merge 1 commit into
base: next-release
Choose a base branch
from
Open

Sidekiq: Pass count through to yml file generator #452

wants to merge 1 commit into from

Conversation

KieranP
Copy link

@KieranP KieranP commented Aug 10, 2020

This allows us to dynamically set which queues to use in sidekiq.yml based on # of workers and the current count

---
:verbose: <%= @verbose %>
<% if @workers > 1 %>
<%# When there is more than one worker, the last one gets one thread reserved for %>
<%# low jobs and the rest of the threads divided up among the remaining jobs %>
<% if (@count + 1) < @workers %>
:concurrency: <%= (@concurrency / (@workers - 1)).ceil %>
:queues:
  - high
  - mailers
  - default
<% else %>
:concurrency: 1
:queues:
  - low
<% end %>
<% else %>
:concurrency: <%= (@concurrency / @workers).ceil %>
:queues:
  - high
  - mailers
  - default
  - low
<% end %>

This allows us to dynamically set which queues to use based on # of workers and the current count
@dvalfre dvalfre requested a review from mushyy August 10, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant