Subscribe to the goodies

Application Performance Improved by 66% using NewRelic!

Julien–Wednesday, 31 October 2012

We increased the performance of a single feature for one of our applications by 66%, providing users with a better software experience.

We used NewRelic to help identify resource costs for a rails 2.3 application and to see if we can improve performance. Once this application was reporting under a NewRelic account it became apparent that one of the most important features of this website was also the slowest.

As you can see in the “web transactions” screen, the Admin::ApplicationsController#show is killing the performances of the website:

Having a look at the “detailled trace” for a specific call shows a horrible “findbysql” eating 78.57% of the time for this request.

NewRelic provides this awesome feature; you can explain the request straight from the interface to see what is wrong.

Yes… this is halloween! On one side we pull 200K of records to match them against 1 row. This request was taking around 3 and 4 seconds and was used most of the time only to do a count.

It took a few minutes to push a fix using a simple SQL JOIN statement and to deploy it into production. The results were impressive! The time of execution of the request was reduced to one millisecond !

The CPU utilization of the RDS instance dropped from 15% to 7%.

It took around one hour from the discovery of the issue in NewRelic to creating a fix and deploying it into production. All of the users are now very happy!