Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 620
Ahmed Haque Avatar asked May 19 '15 06:05

Ahmed Haque


People also ask

Is heroku scalable?

Heroku apps can be scaled to run on multiple dynos simultaneously (except on Free or Hobby dynos). You can scale your app's dyno formation up and down manually from the Heroku Dashboard or CLI. You can also configure Heroku Autoscaling for Performance-tier dynos, and for dynos running in Private Spaces.

How do heroku dynos work?

The containers used at Heroku are called “dynos.” Dynos are isolated, virtualized Linux containers that are designed to execute code based on a user-specified command. Your app can scale to any specified number of dynos based on its resource demands.

Is Procfile a txt?

Procfile naming and location The Procfile is always a simple text file that is named Procfile without a file extension. For example, Procfile. txt is not valid.

What is web and worker in heroku?

Web: Web dynos are dynos of the “web” process type that is defined in your Procfile. Only web dynos receive HTTP traffic from the routers. Worker: Worker dynos can be of any process type declared in your Procfile, other than “web”. Worker dynos are typically used for background jobs, queueing systems, and timed jobs.


1 Answers

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.

like image 180
Damien MATHIEU Avatar answered Sep 21 '22 18:09

Damien MATHIEU