This is the first post in what we plan to be many, outlining the tools we use daily. The first post we decided to talk about profiling Ruby on Rails applications with Skylight.io.
We want this series to help expose readers to good tools they may not be familiar. All of these tools we actually use and consider ourselves experts.
Skylight is relatively new to the world of Ruby on Rails application profilers.
From the Skylight website:
Don’t guess why your app is slow. Skylight tells you exactly how your app is spending its time where it matters most—in your production environment.
Skylight is a smart profiler for your Rails apps that visualizes request performance across all of your servers. It feels a little bit like magic.
I’ve always been fascinated by performance metrics and gaining insight into how an application is running. Tools have improved so much over the years that it’s relatively easy today to be able to find a tool and quickly begin to see how well the application is performing.
We use Skylight to help us gain insight into our running applications. The tooling provides details into application response times and bottlenecks and offers details on what to fix and where.
The screenshot above shows a relatively small application that has consistent requests over a given time. The top graphs showing response time and requests per minute over that period of time. The more interesting and useful information is show in the middle, where each controller is listed with response times.
We always look for the low-hanging fruit first. These are the easiest things to review and fix which result in the largest impact on overall performance. The top two controllers; NewsController’s Index method as well as the HomeController’s Index method are worth investigating.
The red cylinder next to the HomeController tells us Skylight has identified a problem we should look at and fix. Simply clicking on the controller let’s us dig into the details:
Digging deeper we see Skylight is telling us the
SELECT FROM pages in our shared/_nav.html.erb is slow because of a database issue. The color of the horizontal bar tells us where the problem originates. Since this is a share item, a fix here would probably help other parts of the application.
SELECT FROM pages line produces a really nice popup telling us what the offending SQL (in this case) looks like and a nice description of the problem. One of the best parts, Skylight gives us a link to tell us how to fix this particular problem.
We are giving a really nice description of the problem and the approach to fix. It’s important to know how approach, fix and test the issue and that is beyond the scope of this article.
This overview just scratches the surface of the type and level of detail Skylight can give you as a developer or someone put in charge of identifying performance bottlenecks in an application.
Skylight lets you add as many applications as you need, easily switching between each. Pricing is also well thought out, $0 for total monthly requests < 100K and $20 if you stay below 1 million.