How to stop a heroku server?
Asked Answered
D

4

5

I have a staging server hosted on heroku, I just want to bring it down, but not destroy the app. How can I do it? Do I have any command like 'heroku stop' like 'heroku restart' for restarting?

OR

Is there a way to automate the server to turn off itself when it exceeds the 750 hr free usage?

Actually I don't want the server so I am trying to stop it, or leave it for the free hours.

Depressomotor answered 6/2, 2012 at 6:44 Comment(6)
24*31=744, so as long as you have 1 web dyno it'll always be free. No need to stop it.Rid
I have rake tasks, scheduler mailers, crons etc, so It exceeds 750.. Also few rake tasks are running like 5 hours or so which is supposed to be ended in 10 mins..Depressomotor
The pricing page implies you can set the number of web dynos to 0.Caltrop
You can always put something irrelevant in the Procfile so it doesn't launch your rails app/workers/crons, etc.. or enable the maintenance modeSferics
checkout #2811953Peppery
You can also restart it - https://mcmap.net/q/116076/-how-to-restart-a-rails-server-on-heroku/631619Grandioso
D
4

Login to the account, and click on the resource and then bring down the dyno count to 0 and the save. Now you can check by trying to open the site. It will be down.

Depressomotor answered 7/2, 2012 at 4:42 Comment(1)
@NeilMiddleton how do you stop Cedar then?Budgie
E
7

You can scale individual non-web processes down to zero quite happily:

$ heroku ps:scale worker=0
$ heroku ps:scale resque=0
etc...

and web to 1:

$ heroku ps:scale web=1

As Mischa says, you get one free dyno running, so leave your 1 web dyno running (I'm not sure you can stop the last web process)

Etheleneethelin answered 6/2, 2012 at 9:4 Comment(2)
in fact you can. With heroku's new procfile, apps aren't limited to web processes and are allowed to remove them altogether if they're not needed.Fakir
Indeed - but that requires a redeploy in order to stop.Etheleneethelin
D
4

Login to the account, and click on the resource and then bring down the dyno count to 0 and the save. Now you can check by trying to open the site. It will be down.

Depressomotor answered 7/2, 2012 at 4:42 Comment(1)
@NeilMiddleton how do you stop Cedar then?Budgie
A
4

You can put it under maintenance, which stops it but doesn't delete it:

heroku maintenance:on

More info: https://devcenter.heroku.com/articles/maintenance-mode

Aeroscope answered 17/2, 2012 at 22:44 Comment(1)
Not sure if this exactly helps. From their page "Enabling or disabling maintenance mode generally doesn’t alter running dynos. Web dynos continue to run as before"Vulture
B
2

Easily disable/enable the App by going to your Heroku dashboard ==> resource tab the rest is on the picture below:

enter image description here

Basham answered 27/9, 2020 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.