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.
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: