Search code examples
ruby-on-railsruby-on-rails-4nginxprofilingthin

Knowing why a request is slow inside a Rails application before it renders the route


I am rendering a blank page for profiling reasons, it displays the following:

Completed 200 OK in 67ms (Views: 0.8ms | ActiveRecord: 27.6ms)

However, the request took 573ms.

How can I know what's going on before rendering the route ? I am running the app on a laptop with a Core i7-2620MQ and accessing it locally, could this be part of that issue ?


Solution

  • I hope you have taken 573ms time from browser's network timeline. It is not only including server's processing time of the request but also includes,

    1. DNS resolution
    2. Network connectivity

    So, 573ms is the combination of DNS resolution + Network connectivity + Server's processing time.

    It might increase if your local network is slow.

    Rails had taken 67ms to completely process your request(includes routing, processing, and rendering).