Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Enabling preboot for seamless deploys


When we deploy new code to Heroku, all of our dynos are shut down and replaced with new ones simultaneously. If we have long boot times for our application, this can result in our user's requests timing out because our dynos are unable to respond to requests while booting up. We can avoid this using Heroku's preboot, a feature that gives our new dynos an additional 3 minutes to get started before shutting down our old dynos. This gives our application plenty of time to get warmed up and ready to serve requests.

How to do it...

For this recipe, we'll enable Heroku preboot from the CLI. Let's open up a terminal and navigate to a Heroku application to get started by performing the following steps:

  1. First, we'll need to enable preboot for our application:

    $ heroku features:enable preboot
    Enabling preboot for example-app... done
    For more information see: https://devcenter.heroku.com/articles/preboot
    

    Note

    There must be more than one dyno running for preboot to...