Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Monitoring Amazon RDS

Monitoring is an important part of maintaining the reliability, availability, and performance of Amazon RDS and your AWS solutions. You should collect monitoring data from all of the parts of your AWS solution so that you can more easily debug a multi-point failure if one occurs. Before you start monitoring Amazon RDS, we recommend that you create a monitoring plan that includes answers to the following questions:

  • What are your monitoring goals?

  • What resources will you monitor?

  • How often will you monitor these resources?

  • What monitoring tools will you use?

  • Who will perform the monitoring tasks?

  • Who should be notified when something goes wrong?

The next step is to establish a baseline for normal Amazon RDS performance in your environment, by measuring performance at various times and under different load conditions. As you monitor Amazon RDS, you should consider storing historical monitoring data. This stored data will give you a baseline to compare against with current performance data, identify normal performance patterns and performance anomalies, and devise methods to address issues.

For example, with Amazon RDS, you can monitor network throughput, I/O for read, write, and/or metadata operations, client connections, and burst credit balances for your DB instances. When performance falls outside your established baseline, you might need change the instance class of your DB instance or the number of DB instances and Read Replicas that are available for clients in order to optimize your database availability for your workload.

In general, acceptable values for performance metrics depend on what your baseline looks like and what your application is doing. Investigate consistent or trending variances from your baseline. Advice about specific types of metrics follows:

  • High CPU or RAM consumption – High values for CPU or RAM consumption might be appropriate, provided that they are in keeping with your goals for your application (like throughput or concurrency) and are expected.

  • Disk space consumption – Investigate disk space consumption if space used is consistently at or above 85 percent of the total disk space. See if it is possible to delete data from the instance or archive data to a different system to free up space.

  • Network traffic – For network traffic, talk with your system administrator to understand what expected throughput is for your domain network and Internet connection. Investigate network traffic if throughput is consistently lower than expected.

  • Database connections – Consider constraining database connections if you see high numbers of user connections in conjunction with decreases in instance performance and response time. The best number of user connections for your DB instance will vary based on your instance class and the complexity of the operations being performed. You can determine the number of database connections by associating your DB instance with a parameter group where the User Connections parameter is set to a value other than 0 (unlimited). You can either use an existing parameter group or create a new one. For more information, see Working with DB Parameter Groups.

  • IOPS metrics – The expected values for IOPS metrics depend on disk specification and server configuration, so use your baseline to know what is typical. Investigate if values are consistently different than your baseline. For best IOPS performance, make sure your typical working set will fit into memory to minimize read and write operations.

Monitoring Tools

AWS provides various tools that you can use to monitor Amazon RDS. You can configure some of these tools to do the monitoring for you, while some of the tools require manual intervention. We recommend that you automate monitoring tasks as much as possible.

Automated Monitoring Tools

You can use the following automated monitoring tools to watch Amazon RDS and report when something is wrong:

  • Amazon CloudWatch Alarms – Watch a single metric over a time period that you specify, and perform one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon Simple Notification Service (Amazon SNS) topic or Auto Scaling policy. CloudWatch alarms do not invoke actions simply because they are in a particular state; the state must have changed and been maintained for a specified number of periods. For more information, see Monitoring with Amazon CloudWatch.

  • Amazon CloudWatch Logs – Monitor, store, and access your log files from AWS CloudTrail or other sources. For more information, see Monitoring Log Files in the Amazon CloudWatch User Guide.

    Amazon RDS Enhanced Monitoring provides metrics in real time for the operating system that your DB instande or DB cluster runs on. For more information, see Enhanced Monitoring.

  • Amazon CloudWatch Events – Match events and route them to one or more target functions or streams to make changes, capture state information, and take corrective action. For more information, see Using Events in the Amazon CloudWatch User Guide.

  • AWS CloudTrail Log Monitoring – Share log files between accounts, monitor CloudTrail log files in real time by sending them to CloudWatch Logs, write log processing applications in Java, and validate that your log files have not changed after delivery by CloudTrail. For more information, see Working with CloudTrail Log Files in the AWS CloudTrail User Guide.

    For information on using AWS CloudTrail Log Monitoring with Amazon RDS, see Logging Amazon RDS API Calls Using AWS CloudTrail.

  • Amazon RDS Events – Subscribe to Amazon RDS events to be notified when changes occur with a DB instance, DB cluster, DB snapshot, DB cluster snapshot, DB parameter group, or DB security group. For more information, see Using Amazon RDS Event Notification.

  • Database log files – View, download, or watch database log files using the Amazon RDS console or Amazon RDS APIs. You can also query some database log files that are loaded into database tables. For more information, see Amazon RDS Database Log Files.

Manual Monitoring Tools

Another important part of monitoring Amazon RDS involves manually monitoring those items that the CloudWatch alarms don't cover. The Amazon RDS, CloudWatch, and other AWS console dashboards provide an at-a-glance view of the state of your AWS environment. We recommend that you also check the log files on your DB instance.

  • From the Amazon RDS console, here are some of the items that you can monitor for your resources:

    • The number of connections to a DB instance

    • The amount of read and write operations to a DB instance

    • The amount of storage that a DB instance is currently utilizing

    • The amount of memory and CPU being utilized for a DB instance

    • The amount of network traffic to and from a DB instance

  • CloudWatch home page shows:

    • Current alarms and status

    • Graphs of alarms and resources

    • Service health status

    In addition, you can use CloudWatch to do the following:

    • Create customized dashboards to monitor the services you care about

    • Graph metric data to troubleshoot issues and discover trends

    • Search and browse all your AWS resource metrics

    • Create and edit alarms to be notified of problems

Monitoring with Amazon CloudWatch

You can monitor DB instance using CloudWatch, which collects and processes raw data from Amazon RDS into readable, near real-time metrics. These statistics are recorded for a period of two weeks, so that you can access historical information and gain a better perspective on how your web application or service is performing. By default, Amazon RDS metric data is automatically sent to Amazon CloudWatch in 1-minute periods. For more information about Amazon CloudWatch, see What Are Amazon CloudWatch, Amazon CloudWatch Events, and Amazon CloudWatch Logs? in the Amazon CloudWatch User Guide.

Amazon RDS Metrics and Dimensions

When you use Amazon RDS resources, Amazon RDS sends metrics and dimensions to Amazon CloudWatch every minute. You can use the following procedures to view the metrics for Amazon RDS.

To view metrics using the Amazon CloudWatch console

Metrics are grouped first by the service namespace, and then by the various dimension combinations within each namespace.

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. If necessary, change the region. From the navigation bar, select the region where your AWS resources reside. For more information, see Regions and Endpoints.

  3. In the navigation pane, choose Metrics. Choose the RDS metric namespace.

    Choose metric namespace
  4. Select a metric dimension, for example, By Database Class.

    Choose metric dimension
  5. To sort the metrics, use the column heading. To graph a metric, select the check box next to the metric. To filter by resource, choose the resource ID and then choose Add to search. To filter by metric, choose the metric name and then choose Add to search.

    Filter metrics

To view metrics using the AWS CLI

  • At a command prompt, use the following command:

    aws cloudwatch list-metrics --namespace AWS/RDS

Amazon RDS Metrics

The following metrics are available from Amazon Relational Database Service.

MetricDescription
BinLogDiskUsage

The amount of disk space occupied by binary logs on the master. Applies to MySQL read replicas.

Units: Bytes

CPUUtilization

The percentage of CPU utilization.

Units: Percent

CPUCreditUsage

(Only valid for T2 instances) The number of CPU credits consumed during the specified period.

This metric identifies the amount of time during which physical CPUs were used for processing instructions by virtual CPUs allocated to the instance.

Note

CPU Credit metrics are available at a 5 minute frequency.

Units: Count

CPUCreditBalance

(Only valid for T2 instances) The number of CPU credits that an instance has accumulated.

This metric is used to determine how long an instance can burst beyond its baseline performance level at a given rate.

Note

CPU Credit metrics are available at a 5 minute frequency.

Units: Count

DatabaseConnections

The number of database connections in use.

Units: Count

DiskQueueDepth

The number of outstanding IOs (read/write requests) waiting to access the disk.

Units: Count

FreeableMemory

The amount of available random access memory.

Units: Bytes

FreeStorageSpace

The amount of available storage space.

Units: Bytes

ReplicaLag

The amount of time a Read Replica DB instance lags behind the source DB instance. Applies to MySQL, MariaDB, and PostgreSQL Read Replicas.

Units: Seconds

SwapUsage

The amount of swap space used on the DB instance.

Units: Bytes

ReadIOPS

The average number of disk I/O operations per second.

Units: Count/Second

WriteIOPS

The average number of disk I/O operations per second.

Units: Count/Second

ReadLatency

The average amount of time taken per disk I/O operation.

Units: Seconds

WriteLatency

The average amount of time taken per disk I/O operation.

Units: Seconds

ReadThroughput

The average number of bytes read from disk per second.

Units: Bytes/Second

WriteThroughput

The average number of bytes written to disk per second.

Units: Bytes/Second

NetworkReceiveThroughput

The incoming (Receive) network traffic on the DB instance, including both customer database traffic and Amazon RDS traffic used for monitoring and replication.

Units: Bytes/second

NetworkTransmitThroughput

The outgoing (Transmit) network traffic on the DB instance, including both customer database traffic and Amazon RDS traffic used for monitoring and replication.

Units: Bytes/second

Amazon RDS Dimensions

Amazon RDS metrics data can be filtered by using any of the dimensions in the following table:

Dimension

Description

DBInstanceIdentifier

This dimension filters the data you request for a specific database instance.

DBClusterIdentifier

This dimension filters the data you request for a specific Amazon Aurora DB cluster.

DatabaseClass

This dimension filters the data you request for all instances in a database class. For example, you can aggregate metrics for all instances that belong to the database class db.m1.small

EngineName

This dimension filters the data you request for the identified engine name only. For example, you can aggregate metrics for all instances that have the engine name mysql.

Creating CloudWatch Alarms to Monitor Amazon RDS

You can create a CloudWatch alarm that sends an Amazon SNS message when the alarm changes state. An alarm watches a single metric over a time period you specify, and performs one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon SNS topic or Auto Scaling policy.

Alarms invoke actions for sustained state changes only. CloudWatch alarms will not invoke actions simply because they are in a particular state, the state must have changed and been maintained for a specified number of periods. The following procedures outlines how to create alarms for Amazon RDS.

To set alarms using the CloudWatch console

  1. Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose Alarms and then choose Create Alarm. This launches the Create Alarm Wizard.

  3. Choose RDS Metrics and scroll through the Amazon RDS metrics to locate the metric you want to place an alarm on. To display just the Amazon RDS metrics in this dialog box, search for the identifier of your resource. Select the metric to create an alarm on and then choose Next.

  4. Fill in the Name, Description, Whenever values for the metric.

  5. If you want CloudWatch to send you an email when the alarm state is reached, in the Whenever this alarm: field, choose State is ALARM. In the Send notification to: field, choose an existing SNS topic. If you select Create topic, you can set the name and email addresses for a new email subscription list. This list is saved and appears in the field for future alarms.

    Note

    If you use Create topic to create a new Amazon SNS topic, the email addresses must be verified before they receive notifications. Emails are only sent when the alarm enters an alarm state. If this alarm state change happens before the email addresses are verified, they do not receive a notification.

  6. At this point, the Alarm Preview area gives you a chance to preview the alarm you’re about to create. Choose Create Alarm.

To set an alarm using the AWS CLI

Viewing DB Instance Metrics

Amazon RDS provides metrics so that you can monitor the health of your DB instances and DB clusters. You can monitor both DB instance metrics and operating system (OS) metrics.

This section provides details on how you can view metrics for your DB instance using the RDS console and CloudWatch. For information on monitoring metrics for the operating system of your DB instance in real time using CloudWatch Logs, see Enhanced Monitoring.

Viewing Metrics by Using the Console

To view DB and OS metrics for a DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose DB Instances.

  3. Select the check box to the left of the DB cluster you need information about. For Show Monitoring, choose the option for how you want to view your metrics from these:

    • Show Multi-Graph View – Shows a summary of DB instance metrics available from Amazon CloudWatch. Each metric includes a graph showing the metric monitored over a specific time span.

    • Show Single Graph View – Shows a single metric at a time with more detail. Each metric includes a graph showing the metric monitored over a specific time span.

    • Show Latest Metrics View – Shows a summary of DB instance metrics without graphs. Full Monitoring View includes an option for full-screen viewing.

    • Enhanced Monitoring – Shows a summary of OS metrics available for a DB instance with Enhanced Monitoring enabled. Each metric includes a graph showing the metric monitored over a specific time span.

    RDS metrics viewing options

    Tip

    To select the time range of the metrics represented by the graphs, use Time Range.

    You can choose any graph to bring up a more detailed view of the graph, using which you can apply metric-specific filters to the metric data.

    Time Range is not available for the Enhanced Monitoring Dashboard.

DB Instance Metrics

Amazon RDS integrates with CloudWatch metrics to provide a variety of DB instance metrics. You can view CloudWatch metrics using the RDS console, CLI, or API.

For a complete list of Amazon RDS metrics, go to Amazon RDS Dimensions and Metrics in the Amazon CloudWatch User Guide.

Viewing DB Metrics by Using the CloudWatch CLI

Note

The following CLI example requires the CloudWatch command line tools. For more information on CloudWatch and to download the developer tools, go to the Amazon CloudWatch product page. Note that the StartTime and EndTime values supplied in this example are for illustrative purposes. You must substitute appropriate start and end time values for your DB instance.

To view usage and performance statistics for a DB instance

  • Use the CloudWatch command mon-get-stats with the following parameters:

    
    PROMPT>mon-get-stats FreeStorageSpace --dimensions="DBInstanceIdentifier=mydbinstance" --statistics= Average 
      --namespace="AWS/RDS" --start-time 2009-10-16T00:00:00 --end-time 2009-10-16T00:02:00
    					

Viewing DB Metrics by Using the CloudWatch API

Note that the StartTime and EndTime values supplied in this example are for illustrative purposes. You must substitute appropriate start and end time values for your DB instance.

To view usage and performance statistics for a DB instance

  • Call the CloudWatch API GetMetricStatistics with the following parameters:

    • Statistics.member.1 = Average

    • Namespace = AWS/RDS

    • StartTime = 2009-10-16T00:00:00

    • EndTime = 2009-10-16T00:02:00

    • Period = 60

    • MeasureName = FreeStorageSpace

    Example

    
    http://monitoring.amazonaws.com/
    	?SignatureVersion=2
    	&Action=GetMetricStatistics
    	&Version=2009-05-15
    	&StartTime=2009-10-16T00:00:00
    	&EndTime=2009-10-16T00:02:00
    	&Period=60
    	&Statistics.member.1=Average
    	&Dimensions.member.1="DBInstanceIdentifier=mydbinstance"
    	&Namespace=AWS/RDS
    	&MeasureName=FreeStorageSpace						
    	&Timestamp=2009-10-15T17%3A48%3A21.746Z
    	&AWSAccessKeyId=<AWS Access Key ID>
    	&Signature=<Signature>