Ok, I will admit. Its not the simplest app but yet its not the most complicated one either.<p>The rather frustrating part is that most of the time is being spent in rendering views.
Here are few examples.<p>- Completed 200 OK in 272ms (Views: 236.9ms | ActiveRecord: 15.7ms)<p>- Completed 200 OK in 275ms (Views: 148.2ms | ActiveRecord: 42.6ms)<p>- Completed 200 OK in 384ms (Views: 335.1ms | ActiveRecord: 3.5ms)<p>I am not doing partials in a loop etc. I am NOT querying while rendering either.
Its just ruby hash operations etc which are taking up lot of ms.
Now I am starting to wonder is how many SQL queries is considered normal, like in my app its around 4 - 10 queries. Is 300ms+ an acceptable response time for a Rails app which is not even launched yet (so no server load as of now). Hosted on $20 VPS Linode.<p>Thanks in advance for sharing your insights.
No one can tell you what the problem is with that little information. However, here are some suggestions on how <i></i>you<i></i> can yourself debug your problem:<p>Isolate: Eliminate as much as possible until nothing except the problem remains. You can't fix the problem until you know what the problem is, and guessing about it will just lead you astray.<p>Is performance still crap when you remove the db calls? When you replace the db connection with sqlite? When you remove the view logic and just render a static template? When you remove the templates altogether and just render a simple "Hello, world" string? When you put the application on a free Heroku instance instead of Linode?<p>Then ask yourself, does it make sense? Is Ruby so slow that a simple page takes 300 ms to load? Is a $20 (per month? per year?) Linode VPS that crappy?
Have you tried running this anywhere else? How much processing time does a linode vps actually give you? It says activerecord is taking 15ms, that's the time spent querying the database. The view is taking the majority of the time which is normally going to be cpu time because it has to compile the template. Are you running it in cached mode? Because if not its going to read each template off disk before generating the view right?