- Read Tutorial
- Watch Guide Video
In this video, we are going to talk about adding another add-on called "New Relic." Typically, heroku puts infrequently accessed applications in sleep mode, so you're application is going to be slow to load when you try to access it. To get around this, we use an add-on that pings the application from time to time, and this ensures that your application is active all the time.
This add-on is tricky because the owners change the dashboard often, so it's always a good idea to copy code directly from the webpage "https://elements.heroku.com/addons/newrelic".
After installing it, go to heroku and click on this add-on. This will take you to a page where you'll have to select the language, which in this case, is Ruby.
Next, open your gemfile
, and copy this code:
gem `newrelic_rpm`
Run bundle install
and then, download something called newrelic.yml
file from that webpage. Move this file to your config
directory.
Then, upload the changes to github and heroku.
Restart heroku, and let's test it out.
Also, go to browser -> application polices on the New Relic web page. Here you'll see that New Relic will ping your application once every minute, and will send out an email when your application is unresponsive. That's another nice part about this add-on.
Click the application settings button, and enter your application's URL. and save your changes.
That's it! We are all set. I hope you learned a lot from this course, and had fun building this real-time application with me. If you have questions or doubts, feel free to get in touch with me.