Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple rails app performance on heroku

I have a very simple rails 3.2.6 app. I've used Heroku for years to host prototypes, always on the free tier. I finally added a paid dyno on my latest app, and added New Relic to monitor performance.

I'm seeing 4500+ms request times on extremely simple pages with near-zero traffic (we haven't launched yet). New Relic says 99% of this time is spent rendering the template. This is a 75-line completely static haml template inside a 100-line layout. The application template has standard - if current_user.nil? branches.

I haven't added page caching yet. I'll do this of course, but I'd like to determine the root cause of this very poor performance before I cover it up. Any tips? What sort of response times should I expect from Heroku? On my local box in development env, the same page response time is 26ms (with assets coming in before 1.5s). New Relic reports my dynamic pages on Heroku getting average response times of 2000ms to 6000ms.


Edit: I have page caching turned on for static / and am now seeing averages of 173ms. But I'm still concerned with my abysmal averages on dynamic pages.

like image 953
devth Avatar asked Nov 14 '22 03:11

devth


1 Answers

As the comments have also said, my guess is because on the first hit in a while Heroku will have to spin up the app (in the case of free apps) to serve the request, which can make your average requests times quite slow.

like image 113
Scott Schulthess Avatar answered Dec 25 '22 04:12

Scott Schulthess