Database Monitoring and Performance

Using our Database Add-on

Most modern web applications are heavily reliant on persisting data with relational databases, and so it’s no surprise that a large part of application performance monitoring relates to keeping an eye on database performance to ensure that our SQL queries are as efficient as possible.

With this in mind, Scout features a Database Add-on module, and in this video, we are going to take a closer look at what it has to offer.

The Database monitoring page

The database layer of your application is instrumented throughout Scout, in our metrics and traces, and it is a key part of the information that we present to you about your application. But as well as this standard functionality, we also have a special, optional Database Add-on module. 

You can enable the Database Add-on yourself from the billing page at any time. Enabling the Database Add-on gives you access to two features, the Database monitoring page, and the Slow Query Insights tab.

The overview chart and queries list

The Database Add-on allows you to view the performance of your application from a different perspective. Whereas the main overview chart focuses on showing you the performance of your web requests over a period of time, the overview chart on the Database Add-on page focuses on all the database queries in your application instead. Having this different angle of the data can be a useful tool to have when trying to diagnose performance issues or improve efficiency.

The list of queries below the overview chart is ranked from the most intensive queries to the least intensive so that you can quickly see the most significant areas of your application at a glance. You can click into each of these queries for more details. As well as showing an SQL backtrace, we also show you the runtimes of multiple instances of this query being executed, with links to the details of the trace from which they came.

Time selections

One of the nice features about Scout is that time selections you make on one page, follow you around throughout the whole web application. So if you are investigating a specific time period where maybe you noticed a performance spike, you might start looking at that from the main overview page and then think “I wonder what was happening in the database at this time”. Flicking over to the Database Add-on page will show you the answer to this question without you having to set the time frame again.

Furthermore, some of the queries will become greyed out, leaving you with just the queries which significantly changed during the selected time. This is a powerful way of seeing which queries are responsible for or contributed to a performance spike.

Database events

Taking this idea one step further, we also show a list of Database Events on the right side of the page. Here we highlight a large jump in database activity, and, if you click the event, the chart will become highlighted around this time period and the list of queries will grey-out everything except just the queries which significantly changed in rank during this time.

Slow Query Insights

Another nice feature of the Database Add-on is the extra Slow Query Insights tab that you can access from the main page. 

Here we highlight to you the slowest database queries in your application at the time period you have selected in the main overview chart. This can be useful when you are investigating a performance spike and you want to get an idea of database activity at this time.

Conclusion

As you can see the Database Add-on module is a useful feature for your application performance monitoring that database-heavy applications can certainly benefit from having. If you have never used it before, then why not enable it and see for yourself the extra level of detail that it can bring you.