Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6169387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:50:57+00:00 2026-05-23T22:50:57+00:00

The actual problem I am using Rails 3.0.4 and MongoDB through mongoid. I am

  • 0

The actual problem

I am using Rails 3.0.4 and MongoDB through mongoid.

I am using @mailgun to deliver my emails. I send both bulk(like news-letter) and transactional(like activate account, forgot password) emails. Right now, I am using a single domain(translates to single queue on mailgun’s end) to deliver those mails. Problem arises when I have lot of bulk emails already queued up and somebody registers or requests for a new password. I want the transactional emails to be delivered before the bulk mails, but mailgun queue works on a FIFO basis.

I figured a way to mitigate this can be to use different domains(hence different queues which can be processed simultaneously) for bulk and transactional mails. In rails smtp settings are application level settings rather than request level settings. So, I figured, I will use different environments for different smtp setting.

I also have a queue system for mails and am using delayed_job to handle that. I can’t figure out a way to differentiate between bulk and transactional mails in delayed_job. So, I decided to move my queue system to either rescue+redis or beanstalked+stalker, where I can tag queues and can ask a worker to only process a particular queue.

The question

I want something which is easier to maintain, least resource hungry and can scale well.

  • With delayed_job I needn’t run any other server and monitor it.
  • For delayed_job I was using 256MB slice on rackspace, but redis and stalker would require another server, either resque or beanstalkd.
  • I have no idea about scaling, but its 2nd month since my app launched and I have already sent 30k+ emails.

If there any alternatives to porting from delayed_job to redis or stalker, please let me know.

Update:

Seems like delayed_job also have support for named queues now, but it is not documented yet. Opening a ticket to add documentation, will update with details, once I know how to use them 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:50:57+00:00Added an answer on May 23, 2026 at 10:50 pm

    Delayed job accepts an optional priority parameter (it’s explained down near the end of the linked page).

    For example:

    Delayed::Job.enqueue(MailingJob.new(params[:id]), 3)
    

    …where 3 is the priority.

    So, when en-queuing your mass-mailing, don’t specify a priority, and when en-queuing your transactional emails give them something higher. This way, your transactional emails will get entered into the @mailgun queue ahead of anything that isn’t already on its way out.

    Unless your outgoing SMTP server has some kind of slow connection, it’ll probably send several hundred emails per minute, so I wouldn’t worry too much if there are, for example, 200 mass-mailings already handed off to @mailgun and you’re waiting on a transactional email; it will still send shortly thereafter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: The actual problem is the non-quoted code. I want
Ok, my actual problem was this: I was implementing an IList<T> . When I
This is more of a theoretical question than an actual problem I have. If
I'm interested in actual examples of using fixed point combinators (such as the y-combinator
I have managed to run a basic rails app1 on App Engine using: http://gist.github.com/268192
I have started using Linq to SQL in a (bit DDD like) system which
I have a problem using compass-style remotley over ssh and my favorite text-editor textmate.
I'm having a very annoying problem using Facebook's sign-on. It works perfectly fine when
I'm attempting to solve the producer-consumer problem using pthreads and semaphores, but it looks
I have a problem using a method defined on a model in CanCan abilities:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.