Can someone explain "heroku ps:scale web=1"

Ahmed Haque picture Ahmed Haque · May 19, 2015 · Viewed 12.6k times · Source

I'm looking for a straightforward explanation of what all happens when I enter the following command:

heroku ps:scale web=1 

What is Heroku doing behind the scenes to deploy the app? I ask because I'm just now using Heroku to deploy and would like to better understand the process. Thanks!

Answer

Damien MATHIEU picture Damien MATHIEU · May 19, 2015

This command does not deploy the app. It starts it, after you have deployed.

When you deploy your application, heroku creates a "slug". A runnable zipped version of your app which is then stored. You can then start "dynos", which take your current slug and start it on one of heroku's servers.

Running heroku ps:scale web=1 will scale your app to one running dyno, basically meaning you have one server running your app currently.

If you deploy your app again, a new slug will be generated and stored, and your currently running dynos will be destroyed, to be replaced by new ones with the new version of your code.