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 7870727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:42:15+00:00 2026-06-03T01:42:15+00:00

I am developing a website in Rails that will have to run a script

  • 0

I am developing a website in Rails that will have to run a script once a day. The script reads xml-feeds and updates the database. I am using Rails 3.1.1 and run the website on Heroku.

What options do I have here in order for the script to not completely kill the website when it is run? Adding a dyno I think would solve it but is quite expensive, especially since it is not really needed outside when I run the script.

Could I run the script on another database and copy it? Run it in the background? In short, what options do I have?

Edit: I wasn’t really clear here. My issue here is to affect the webserver/database as little as possible, not to run the script (with whenever etc). I am planning to run the script during the night to affect as little as possible, but still I don’t want the website to be completely down during that hour.

  • 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-06-03T01:42:16+00:00Added an answer on June 3, 2026 at 1:42 am

    A lot of this depends on the performance characteristics of your script. If is very cpu intensive but otherwise low impact then I wouldn’t worry: when using something like heroku scheduler the job runs in a separate dyno. Since it’s a separate dyno it won’t affect your other dynos that are serving requests.

    Heavy database usage is another thing all together. Your database has a finite amount of IO, cache, CPU etc. and if you are pushing it hard (where lots of writes is generally worse than lots of reads, since those bust caches) then you can degrade performance for your other dynos.

    It is also possible to stop the website from working at all – if you job ends up taking locks on rows/tables that the rest of the app is trying to access then your web dynos will be blocked until your job releases those locks.

    If you’re parsing a feed an updating db rows one by one as you traverse the feed, you’ll probably be ok: lots of little writes/reads are better than massive ones in terms of lock contention and I don’t think you’ll be hitting the db that hard since it sounds like you’d mostly be loading one row at a time from an indexed column, doing some ruby calculations and then updating a single row.

    If you do find that performance is being degraded unacceptably, and if the bottle neck is reads then one way out is to have a read slave (also known as a replica, or in heroku speak a follower). In a nutshell this is a separate, read only, database server that tracks the main database server (so it’s always pretty much up to date). Anything you do to this server can’t affect your master db, so you can query away without worrying.

    This doesn’t help you if the problem is the number of writes you need to do. To an extent this can be solved (at a cost) by switching to a beefier database server. Different types of data store (e.g. mongo, redis) are sometimes more appropriate than a relational database for some usage patterns. Sometimes it is possible to architect out some of your performance hot spots, but clearly you’re the one best placed to consider that.

    This is all very abstract – the only way you’ll really know is by trying. Setup a copy of your app, kick off this task and see how performance degrades (or do this against the real app if you’re not worried about a one-off impact)

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

Sidebar

Related Questions

I am developing a website that connects to a users MSSQL database to collect
I am developing a website that relies much on XML data. The web site
I'm currently developing a website that allows a search on a PostgreSQL database, the
Im developing a Rails app that will contain a web front end as well
I am developing a Ruby on Rails website and I have an architectural question
I'm developing a website with Ruby on Rails and I have a div with
I'm developing a website (in Django) that uses OpenID to authenticate users. As I'm
Developing rails has become lots of fun over the year that I've done it,
I'm developing a website in Ruby on Rails to sell valuable goods. We need
I have built a custom administration panel into a Rails application that allows content

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.