Using Performance Insights
Start course
2h 19m

This section of the SysOps Administrator - Associate learning path introduces you to the AWS database services relevant to the SOA-C02 exam. We will understand the service options available and learn how to select and apply AWS database services to meet specific design scenarios relevant to the exam. 

Learning Objectives

  • Understand the various database services that can be used when building cloud solutions on AWS
  • Learn how to build databases using Amazon RDS, DynamoDB, Redshift and Elasticache 
  • Learn how to perform database backups across different services
  • Understand how to implement database solutions with high availability in mind 
  • Understand the methods and techniques that can be used to enhance performance across your databases

When users complain of poor performance, it is now possible to see whether or not it's the database. Performance Insights will show if the database is under load. For example, if AAS is less than one, the database is not blocked. This means the problem exists somewhere outside of the database.

If I can avoid meetings, discussions, and arguments over where a problem could be, I will.

If the number of Average Active Sessions, AAS, is greater than than the number of available cores, as shown by the line Max CPU in the load graph, the problem is, indeed, the database. Now nobody has to waste time troubleshooting application software or network connections.

Performance Insights can be used to optimize the RDS instance size. Over time, if the AAS value is significantly less than the number of available CPU cores, the database instance is too large. The opposite is also true. If AAS is larger than the number of cores, the instance is too small.

If, inside the load graph, there is a significant number of IO-based waits, investigating storage options would be worth the time and effort.

The Performance Insights dashboard is part of the RDS Management Console. Within the console, there are two ways to access it. On the left-hand side, it's available in the Amazon RDS menu. Click on the link to be taken to a list of RDS instances that have Performance Insights enabled. Then, select the appropriate database from this list to get to its dashboard.

The other way to get to Performance Insights from the RDS dashboard is from the column on the database list named Current Activity. If Performance Insights is enabled on the database, the Current Activity column will show a blue rectangle and the number of active sessions. An empty rectangle indicates an idle instance. As load increases, the bar fills with blue. There's a vertical red line in the blue rectangle that indicates the capacity of the instance. When the load exceeds instance capacity, it changes to red. Clicking on the blue bar graph will take you directly to the Performance Insights dashboard for that RDS instance.

When there is load on the database, Performance Insights data is automatically published to Amazon CloudWatch. This means that CloudWatch alarms can be defined to alert, notify, and trigger automation as needed. Inside Cloudwatch, the three metrics available are DBLoad, DBLoadCPU, and DBLoadNonCPU. DBLoad is the number of average active sessions on the database engine. DBLoadCPU is the number of average active sessions where the wait event type is CPU. DBLoadNonCPU is the number of average active sessions where the wait event type is not CPU.

Using the Command Line Interface to get the statistics for the DBLoad metric, use the get-metric-statistics command. These command examples request data from Amazon CloudWatch for an RDS instance in the region US-West-2. What will be returned is the DBLoad metric using a period of 60 seconds within the provided start and end times.

Performance Insights data is also available within Amazon CloudWatch via a public API. This API can also be used for programmatic access including the command line interface. With CloudWatch, the API data can be used to create dashboards.

Amazon CloudWatch dashboards are customizable views of the metrics and alarms for AWS resources. Each dashboard can display multiple metrics and can be accessorized with text and images to assess the health of resources and applications across one or more regions.

Cloud Academy has a course on Amazon CloudWatch. It covers monitoring AWS resources, alerting, and creating dashboards.

Amazon RDS Performance Insights provides a public API for data access. The API can be used to offload data into a database, add Performance Insights data to existing monitoring dashboards, or to build custom monitoring tools. 

Performance Insights can also be viewed and saved using the AWS CLI. Possible use cases include retrieving counter metrics, load average filtered by SQL query, or the database load average for top SQL and Wait events. From the command line, view the help for Performance Insights using the command aws pi help.

The GetResourceMetrics operation retrieves one or more time-series metrics from the Performance Insights data. GetResourceMetrics requires a metric and a time period, and returns a list of data points. The RDS Management Console uses GetResourceMetrics in two places in the Performance Insights dashboard.

GetResourceMetrics is used to populate the Counter Metrics chart in the Database Load chart. All metrics returned by GetResourceMetrics are standard time-series metrics with one exception; db.load, the core metric in Performance Insights. This metric is displayed in the Database Load chart.

The db.load metric is different from the other time-series metrics because it can be broken into sub-components called dimensions. Here, db.load is broken down and grouped by the waits states.

The AWS Performance Insights API provides visibility into the performance of an RDS instance. Amazon CloudWatch is the authoritative source for AWS monitoring metrics.

Performance Insights offers a domain-specific view of database load measured as Average Active Sessions and provided to API consumers as a two-dimensional time-series dataset.

The time dimension of the metric provides load data for each time point in the queried time range, and each time point can be further broken down into SQL, Wait-event, User, or Host.

About the Author
Learning Paths

Stuart has been working within the IT industry for two decades covering a huge range of topic areas and technologies, from data center and network infrastructure design, to cloud architecture and implementation.

To date, Stuart has created 150+ courses relating to Cloud reaching over 180,000 students, mostly within the AWS category and with a heavy focus on security and compliance.

Stuart is a member of the AWS Community Builders Program for his contributions towards AWS.

He is AWS certified and accredited in addition to being a published author covering topics across the AWS landscape.

In January 2016 Stuart was awarded ‘Expert of the Year Award 2015’ from Experts Exchange for his knowledge share within cloud services to the community.

Stuart enjoys writing about cloud technologies and you will find many of his articles within our blog pages.