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

  • Home
  • SEARCH
  • 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 6707707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:40:17+00:00 2026-05-26T07:40:17+00:00

Am I right in thinking the most efficient way to run a background process

  • 0

Am I right in thinking the most efficient way to run a background process every 2 hours on heroku (e.g. sending emails / stats collection etc.) is to use a cron, scheduled for every two hours, that then sticks items in a delayed_jobs queue (based on the dj gem) that is then picked up by a heroku worker instantly?

Further to that, once the app is in production, am I right in thinking the cost-effective approach would be to have hirefire spin up a worker to carry out the job and then shut it down afterwards?

Are there other approaches I should consider? I have not done this kind of delayed job work before – in development and in basic production testing before go live I have it all based on a heroku cron – but in production that doesn’t seem sensible if the load on the cron job increases.

Any pointers on worthwhile alternative approaches appreciated!

  • 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-26T07:40:18+00:00Added an answer on May 26, 2026 at 7:40 am

    Hirefire is definitely the way to go if you don’t have a full time set of work for a worker to do as you’ll be paying for a dormant worker otherwise.

    Another option for the timing is to get the delayed job to reschedule itself when it completes using the :run_at argument that’s available. The worker will then do it when it’s hit the time (although I’ve never tested this would work with Hirefire as I think they just look at Job count)

    It’s a pretty sound approach overall, and what I would use.

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

Sidebar

Related Questions

I don't know if I'm thinking of this the right way, and perhaps somebody
Whats the most efficient way to add different icons to a large number of
Am I right in thinking the full name of the LSP is the Liskoff
Am I right in thinking that until I am able to afford dedicated servers
Am I right in thinking that the HTML5 peertopeerconnection() for enabling peer to peer
What are the different types of encapsulation? Am I right in thinking this basically
Right now I'm thinking write the paths to a file in the pre-build event
Right now, I keep all of my projects on my laptop. I'm thinking that
I'm looking for an efficient way to implement the same kind of layout that
I'm thinking about how to handle sending large amounts of email from my web

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.