The course is part of these learning paths
This course explores Amazon RDS Performance Insights, a performance monitoring and tuning feature that can quickly assess the load on a database hosted inside Amazon RDS and determine when and where to take action.
In this course, you will learn what the Performance Insights service is, how it provides meaningful information database load, how to use it, and the costs and security features of the service.
If you have any feedback relating to this course, please contact us at firstname.lastname@example.org.
- Obtain a foundational understanding of Amazon RDS Performance Insights
- Learn how Performance Insights measures database load and adds context to AAS (Average Active Sessions)
- Learn how to use Performance Insights
- Understand how to control access to Performance Insights
- Understand the costs associated with using the service
This course is intended for both new and experienced database administrators that need to assess, understand, and optimize the load that users and applications put on an RDS database.
To get the most out of this course, you should have a basic understanding of relational databases, have created at least one RDS database instance, and a working knowledge of the AWS cloud platform.
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.
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.
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.
Stephen is the AWS Certification Specialist at Cloud Academy. His content focuses heavily on topics related to certification on Amazon Web Services technologies. He loves teaching and believes that there are no shortcuts to certification but it is possible to find the right path and course of study.
Stephen has worked in IT for over 25 years in roles ranging from tech support to systems engineering. At one point, he taught computer network technology at a community college in Washington state.
Before coming to Cloud Academy, Stephen worked as a trainer and curriculum developer at AWS and brings a wealth of knowledge and experience in cloud technologies.
In his spare time, Stephen enjoys reading, sudoku, gaming, and modern square dancing.