How to check the start of my Rails application?

I put the Rails application on Heroku and now I see that it has a very slow startup time. What I mean is that when I first go to my website on Heroku (using a browser), it takes too much time to display the index page, but when I browse the website, the requests are executed at normal times.

So, as I see it, it takes so much time for this "first" request?

+4
source share
1 answer

this is normal because you are not paying for your dynamo, and the first dynamo will be idle after a certain time.

http://devcenter.heroku.com/articles/dynos

Applications that have only 1 web dino will be disabled after a period of inactivity. The network speaker will be turned off. When a request arrives in an idle application, your web dino will automatically spin back, causing a few seconds of delay for this first request. Subsequent requests will be executed as usual.

Applications that have more than 1 web dino never launch. Working speakers never stand idle.

If you want to see what happens, you can use this command (from the installation directory)

hero magazines

It will show the logs of your server.

In my intermediate environment, if I request now (when my dynamo is idling), I see in the logs

2012-02-18T12:17:24+00:00 heroku[web.1]: Unidling 2012-02-18T12:17:24+00:00 heroku[web.1]: State changed from down to created 2012-02-18T12:17:24+00:00 heroku[web.1]: State changed from created to starting [.....] 2012-02-18T12:17:42+00:00 heroku[router]: GET [...] dyno=web.1 queue=0 wait=0ms service=9ms status=200 bytes=0 

=> It took about 20 seconds to fill out my first request.

+1
source

Source: https://habr.com/ru/post/1397174/


All Articles