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

How to send out 2 campaign email blasts in parallel (and not delevered in series)? (Question) #330

Open
RESP-hub opened this issue Sep 21, 2016 · 2 comments

Comments

@RESP-hub
Copy link

RESP-hub commented Sep 21, 2016

I am using the email sending delay feature successfully with 2 concurrent Sidekiq workers and background email enabled. So that works fine.

My question: Sometimes I want to send-out two different campaigns around the same time, and have them both using delayed sending to deliver the emails in a timespan of 2 hours, for example. The issue is that with the curreny code the first campaign blasts need to finish before the 2nd blast will start. I believe this is normal behavior of the current code, given the fact that each blast is put in the 'default' sidekiq Q and as such executed in series by the workers.

What would be the easiest approach (on 1 server instance) to have 2 blasts being send out in delayed mode but in true parallel fashion in their own Q, with their own workers? I believe the following could maybe work:

  • Define at least two Sideiq Q's with with equal weight:
    https://github.com/mperham/sidekiq/wiki/Advanced-Options
  • Add an option in the Campaign GUI screen to indicate the Q to use. (Not sure in which file to add this best)
  • Change the code somewhere to hand-off each blast in the indicated Q. (Not sure in which file to add this best)

Can anyone confirm if this will technically be possible and if this is the right technical approach? Can anyone point to the files where changes are needed? Any help would be greatly appreciated. Thanks.

@zeknox
Copy link
Member

zeknox commented Sep 21, 2016

This is a good question and I thought that if you were sending emails in the background that you could launch 2 campaigns in parallel using sidekiq. You make it sound like my theory is incorrect. Sidekiq should be able to handle upto 5 different blasts at a time (in theory).

I'm currently in a bit of a refactor of this code as I work towards upgrading to the latest version of rails and ruby. I should be able to test this out as I refactor.

@RESP-hub
Copy link
Author

It is indeed true that you can launch 2 or more campaigns at the same time. But because all emails are Q'ed in the 'default' sidekiq Q. The schedules campaigns (blasts) are send out in series. I think the technology is all in place to make it truely parallel. For instance based on a manual selection of some predefined (hardcoded) queues in the campaign details page. Lets say we create 10 queues to select from in the GUI. If the queue does not exist we could default to the 'default' q.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants