Performance Zone is brought to you in partnership with:

Jim spent years on the user side of APM solving problems, fighting fires, and trying to convince all of his APM vendors that they could (and should) do better. His passion for performance tuning and troubleshooting led him from systems and application administration to working as an APM Architect tasked with designing an integrated ecosystem capable of monitoring next generation data centers and the applications housed within. Jim never passed up an opportunity to test drive and provide feedback on (pick apart) an APM vendors offering so he has used most of the tools out there. Jim’s viewpoint is a result of work in a high pressure Financial Services environment but his methods and approach apply to any IT organization that strives for greatness. Jim is a DZone MVB and is not an employee of DZone and has posted 28 posts at DZone. You can read more from them at their website. View Full User Profile

How To Set Up and Monitor Amazon RDS Databases

06.10.2013
| 4876 views |
  • submit to reddit

Relational databases are still an important application component even in today’s modern application architectures. There is usually at least one relational database lurking somewhere within the overall application flow and understanding the behavior of these databases is major factor in rapidly troubleshooting application problems. In 2009, Amazon launched their RDS service which basically allows anyone to spin up a MySQL, Oracle, or MS-SQL instance whenever the urge strikes.

While this service is amazingly useful there are also some drawbacks:

  1. You cannot login and access the underlying OS of your database instance. This means that you can’t use any agent based monitoring tools to get the visibility you really want.
  2. The provided CloudWatch monitoring metrics are high level statistics and not helpful in troubleshooting SQL issues.

The good news is that you can monitor all of your Amazon RDS instances using AppDynamics for Databases (AppD4DB) and in this article I will show you how. If you’re unfamiliar with AppD4DB click here for an introduction.

Setting Up A Database Instance In RDS

Creating a new database instance in RDS is really simple.

Step 1, login to your Amazon AWS account and open the RDS interface.

 RDS 1

Step 2, Initiate the “Launch a DB Instance” workflow.

RDS 2

Step 3, select the type of instance you want to launch. In this case we will use MySQL but I did test Oracle and MS-SQL too.

RDS 3

Step 4, fill in the appropriate instance details. Pay attention to the master user name and password as we will use those later when we create our monitoring configuration (although we could create a new user only for monitoring if we want).

RDS 4

Step 5, finish the RDS workflow. Notice I called the database “wordpress” as I will use it to host a WordPress instance. Also notice that we chose to use the “default” DB security group. You will need to access the security group settings after your new instance is created so that you allow access to the database from the internet. For the sake of testing I opened up my database to 0.0.0.0/0 (not shown in this workflow) which allows the entire internet to connect to my database if they have the credentials. You should be much more selective if you have a real database instance with production applications connected.

RDS 5

RDS 6

RDS 7

Step 6, wait for your instance to be created and watch for the “available” status. When you click on the database instance row you will see the details populate in the “Description” tab below. We will use the “Endpoint” information to connect AppD4DB to our new instance. (At this point you can also build the database structure and connect your application to your running instance.)

RDS 8

Monitor Your Database With AppD4DB

Step 1, enable database monitoring from the “Agent Manager” tab in AppD4DB. Notice we map RDS “Endpoint” to AppD4DB “Hostname or IP Address” and in this case we are using the RDS “Master Username” and “Master Password” for “Username” and “Password” in AppD4DB. Also, since Amazon does not allow any access to the associated OS (via SSH or any other method) we cannot enable OS monitoring.

RDS 9

Step 2, start your new database monitoring and use your application. Here is a screen grab showing a couple of slow SQL queries.

RDS SQL Activity

The Results

So here is what I found for each type of database offered by Amazon RDS.

  • MySQL: Fully functional database monitoring.
  • Oracle: Fully functional database monitoring.
  • MS-SQL: All database monitoring functionality works except for File I/O Statistics. This means that we are 99% functional and capture everything else as expected including the ability to show SQL execution plans.

Amazon RDS makes it fast and easy to stand up MySQL, MS-SQL and Oracle databases. AppDynamics for Databases makes it fast and easy to monitor your RDS databases at the level required to solve your application and database problems. Sounds like a perfect match to me. Sign up for your free trial of AppD4DB and see for yourself today.

Published at DZone with permission of Jim Hirschauer, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)