Home Is a rake task calling a rake task bad in terms of memory usage?
Reply: 0

Is a rake task calling a rake task bad in terms of memory usage?

user981
1#
user981 Published in April 26, 2018, 5:30 pm

I have a list of tasks in my ruby on rails app which are called by a scheduler. In short, I use a scheduler to call rake perform_hourly once every hour.

task :perform_hourly => :environment do

  require 'platform-api'
  heroku = PlatformAPI.connect_oauth('<my api key>') 

      heroku.dyno.create('myapp', {
        :command => "rake fetch_products",
        :attach => false
      })  
end

task :fetch_products => :environment do
// Do product fetching stuff
end

Will this cause two instances of the app to be loaded into memory? One for perform_hourly and one for fetch_products? Thus, making my app use 3x the amount of avg instance memory during the running of these tasks?

It doesn't look like it, according to what I can see on New Relic but, on the other hand, I am trouble shooting many different issues at the same time and I want to rule this one out.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.33368 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO