DEV Community

Discussion on: Cut your Rails boot times on Heroku in half with a single command

Collapse
 
martinstreicher profile image
Martin Streicher

How did you benchmark your boot time on Heroku? Are there any metrics in the Heroku dashboard?

Collapse
 
dbackeus profile image
David Backeus • Edited

Heroku doesn't provide any help in this regard. The approach I used was to heroku run bash to enter a bash shell and then run rails runner to load the Rails app via time NEW_RELIC_AGENT_ENABLED=false rails runner 'puts "done"'. The first run provides the number you want to pay attention to. For subsequent runs the bootsnap cache will be in place whether you enabled the lab feature or not.

Note that I explicitly turned off the NewRelic agent via ENV since I found that otherwise NewRelic adds ~4s of irrelevant boot time noise (ie. it would not be present when running rails console).