Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Cedar: How to scale WEB dynos based on time of day

I want my Rails 3.1 app to scale up to 1 web dyno at 8am, then down to 0 web dynos at 5pm.

BUT, I do not want to sign up for a paid service, and I cannot count on my home computer being connected to the internet.

It seems like the Heroku Scheduler should make this trivial. Any quick solutions or links?

like image 373
dnszero Avatar asked Feb 08 '12 01:02

dnszero


Video Answer


1 Answers

As an update to @Ren's answer, Heroku's Platform API gem makes this really easy.

heroku = PlatformAPI.connect_oauth(<HEROKU PLATFORM API KEY>)
heroku.formation.batch_update(<HEROKU APP NAME>, {"updates" => 
  [{"process" => <PROCESS NAME>, 
  "quantity" => <QUANTITY AS INTEGER>, 
  "size" => <DYNO SIZE>}]
})
like image 161
Galen Avatar answered Sep 21 '22 15:09

Galen