title: Rails 3.2.1 app in production running slow
body: <p>I have a Rails app running on rackspace on postgreSQL.</p>
  
  <p>It is really slow. </p>
  
  <p>On special requests it uses up to 4 sec to respond</p>
  
  <p>I have installed new relic.</p>
  
  <p>I can see that for example the index action of some controllers are the slowest. They are really simple with a few finds. </p>
  
  <p>So, I really don't understand what slows it down.</p>
  
  <p>I wonder if you all can mention some gems that can find performance issues? </p>
  
  <p>I know about bullet, that helps with finding n+1 queries to the database, but that is not my problem. </p>
  
  <p>By request I add the index action of the projects controller(average of 4000 ms response time)</p>
  
  <pre><code>def index
      @firm = current_firm
      @projects = current_user.projects.is_active
      @customers = @firm.customers
      @project = Project.new
      @todo = Todo.new
  end
  </code></pre>
  
  <p>The is_active method is a scope in the model</p>
  
  <pre><code>scope :is_active, where(["active = ?", true])
  </code></pre>
  
  <p>From the application controller I have some helpers and before_filters. One of them could be the problem(or something else) That's why I'd like to have some tools for tracking down performance issues. </p>
  
  <p><strong>Update</strong>
   looking at the production.log I see</p>
  
  <pre><code>Rendered logs/_list_header.html.erb (0.3ms)
  Rendered logs/_log.html.erb (127.7ms)
  Rendered private/log_range.js.erb (721.2ms)
  Completed 200 OK in 836ms (Views: 733.2ms | ActiveRecord: 43.9ms)
  
  Processing by ProjectsController#index as HTML
  Rendered projects/_index.html.erb (4149.8ms)
  Rendered projects/index.html.erb within layouts/application (4157.0ms)
  Rendered layouts/_header.html.erb (0.3ms)
  Completed 200 OK in 6682ms (Views: 4199.6ms | ActiveRecord: 457.0ms)
  
  Processing by LogsController#stop_tracking as JS
  Parameters: xxxxx
  Rendered logs/_tracking_partial.html.erb (121.1ms)
  Rendered logs/_start_tracking.html.erb (6877.9ms)
  Rendered logs/_log.html.erb (43.0ms)
  Rendered logs/stop_tracking.js.erb (7224.0ms)
  Completed 200 OK in 9968ms (Views: 7617.2ms | ActiveRecord: 455.3ms)
  </code></pre>
  
  <p>look at the last one. A lot of time spent rendering views and js. What can cause this. There is no finds in the views. I just use a instance variable form the controller. And there is less than 20 entries in the database. Could this be caused by a slow internet connection on the computer accessing these views?</p>