Using Performance Insights


Course Introduction
RDS vs. EC2
RDS vs. EC2
DynamoDB Accelerator

The course is part of this learning path

Start course
4h 21m

This section of the AWS Certified Solutions Architect - Professional learning path introduces you to the AWS database services relevant to the SAP-C02 exam. We then understand the service options available and learn how to select and apply AWS database services to meet specific design scenarios relevant to the AWS Certified Solutions Architect - Professional exam. 

Want more? Try a Lab Playground or do a Lab Challenge

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, DocumentDB, Keyspaces, and QLDB
  • Learn how to create ElastiCache and Neptune clusters
  • Understand which AWS database service to choose based on your requirements
  • Discover how to use automation to deploy databases in AWS
  • Learn about data lakes and how to build a data lake in AWS

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

Danny has over 20 years of IT experience as a software developer, cloud engineer, and technical trainer. After attending a conference on cloud computing in 2009, he knew he wanted to build his career around what was still a very new, emerging technology at the time — and share this transformational knowledge with others. He has spoken to IT professional audiences at local, regional, and national user groups and conferences. He has delivered in-person classroom and virtual training, interactive webinars, and authored video training courses covering many different technologies, including Amazon Web Services. He currently has six active AWS certifications, including certifications at the Professional and Specialty level.