I think this is a good discussion to have, in terms of appropriate use of 'free resources' to keep the plan sustainable, and "reasonable pricing for the 'little guy'" with tons of small apps that don't get daily usage.
Those topics are important, but not something that will be resolved any time soon, the more tractable computing problem is how to best optimize a site on the free plan, so as to minimize the impact of spinning up a dyno. A few strategies: 1. use browser and http caching for as much as you can 2. use a cdn like cloudflare.com or others 3. reduce dependencies for your app? 4. figure out what is slow, and how to improve it.... I'm not really sure what is happening in the spin up of a dyno, and what I could do to make it better. I just hit an idle app of mine and looked in the logs to see what it was doing. 2012-02-17T18:22:35+00:00 heroku[web.1]: Unidling 2012-02-17T18:22:35+00:00 heroku[web.1]: State changed from down to created 2012-02-17T18:22:35+00:00 heroku[web.1]: State changed from created to starting 2012-02-17T18:22:39+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 56060 -c ./config/unicorn.rb` 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.412560 #1] INFO -- : listening on addr=0.0.0.0:56060 fd=3 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.413000 #1] INFO -- : worker=0 spawning... 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.416644 #1] INFO -- : worker=1 spawning... 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.417177 #9] INFO -- : worker=0 spawned pid=9 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.417390 #9] INFO -- : Refreshing Gem list 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.418434 #1] INFO -- : worker=2 spawning... 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.420059 #1] INFO -- : worker=3 spawning... 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.420874 #12] INFO -- : worker=1 spawned pid=12 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.421081 #12] INFO -- : Refreshing Gem list 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.425084 #1] INFO -- : master process ready 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.426771 #14] INFO -- : worker=2 spawned pid=14 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.426987 #14] INFO -- : Refreshing Gem list 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.446178 #18] INFO -- : worker=3 spawned pid=18 2012-02-17T18:22:41+00:00 app[web.1]: I, [2012-02-17T18:22:41.446496 #18] INFO -- : Refreshing Gem list 2012-02-17T18:22:42+00:00 heroku[web.1]: State changed from starting to up 2012-02-17T18:22:48+00:00 app[web.1]: Cannot find or read /app/config/newrelic.yml 2012-02-17T18:22:55+00:00 app[web.1]: Cannot find or read /app/config/newrelic.yml 2012-02-17T18:22:56+00:00 app[web.1]: Cannot find or read /app/config/newrelic.yml 2012-02-17T18:22:56+00:00 app[web.1]: worker=1 ready 2012-02-17T18:22:56+00:00 app[web.1]: 2012-02-17T18:22:56+00:00 app[web.1]: 2012-02-17T18:22:56+00:00 app[web.1]: Started GET "/" for 67.162.61.119 at 2012-02-17 18:22:56 +0000 2012-02-17T18:22:57+00:00 app[web.1]: Cannot find or read /app/config/newrelic.yml So if I'm reading this right, a request came in at 18:22:35, and woke up the dyno, and that request passed through to the app at 18:22:56, meaning there was about a 21 second delay. There seems to be some time in between each " Cannot find or read /app/config/newrelic.yml" I wonder if putting that config in there would make the spin up faster? I'm also spinning up 4 unicorn workers, would it be faster to start with only 1 or 2, and then add the others later (is that something that could/should be done programmatically?) I'm curious what other people are seeing for dyno spin up times, and any strategies for making things go faster. (Wonder if I'm including any gems that are not needed in prod, and if that has an impact) Run heroku logs for one of your idled dynos, then hit the url and see how long it takes, is there a lot of variation? (bamboo vs cedar, thin vs. unicorn, rails vs. sinatra, etc) On Fri, Feb 17, 2012 at 12:27 PM, Daniel Huckstep < [email protected]> wrote: > I thought the Cedar dynos didn't turn off when idle. Can't remember where > I got that idea from though, so I'm probably entirely wrong. > > But there's also http://devcenter.heroku.com/articles/dyno-idling which > suggest that you could scale your web dynos to zero (on Cedar) and use a > different process name to run the webserver (I'm assuming this would work, > haven't tried it). This is because the other processes (non web) could be > used for other fun things, like running redis (there was an example in a > presentation that showed some TCP routing) which you don't want to turn off. > > Also, in your post you say 450 hours, which is incorrect. It's 750. > > -- > You received this message because you are subscribed to the Google Groups > "Heroku" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/heroku/-/h5MWNmpn3JIJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/heroku?hl=en. > -- Thanks, -John -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
