Scaling Dynos and Workers on Bamboo

Last Updated: 07 February 2014

cli

Table of Contents

This article applies to apps on the Bamboo stack. For the most recent stack, Cedar, see Scaling Your Dyno Formation on Heroku Cedar.

The Cedar stack is not limited to hard-coded process types and allows for a fully customizable process model.

On the Bamboo stack there are two types of dynos available. Web dynos are responsible for running the web application processes that receive and respond to HTTP traffic whereas worker dynos run background jobs with Delayed Job.

Scaling web dynos

Use the heroku ps:scale command to scale web dynos on Bamboo.

$ heroku ps:scale dynos=1
my-app now running 1 dynos

The CLI accepts either an absolute quantity or an increment from the current number of dynos.

$ heroku ps:scale dynos+2
my-app now running 3 dynos

Decrements are also recognized.

$ heroku ps:scale dynos-1
my-app now running 2 dynos

Scaling worker dynos

heroku ps:scale command also scales background workers in the same fashion as dynos, accepting either absolute quantities or increment/decrements.

$ heroku ps:scale workers=2
my-app now running 2 workers

$ heroku ps:scale workers-1
my-app now running 1 workers

Introspection

The current number, types and state of dynos running is always available with the heroku ps command.

$ heroku ps
=== web: `bundle exec thin start -p $PORT -e production`
web.1: idle for 1628h
web.2: up for 4m

=== worker: `bundle exec rake jobs:work`
worker.1: crashed for 1m

Scaling via the web UI

Though scaling via the CLI is preferred it is also possible to scale dynos and workers on the web interface. Login to Heroku and view the resources for the application in question. The URL will look something like: https://api.heroku.com/myapps/my-app/resources.

Applications can scale beyond 24 dynos by using the CLI.

Use the two vertical sliders to adjust the web and worker dynos up to the UI-limit of 24.

Heroku scaling sliders