Key metrics in Amazon RDS monitoring

Amazon Relational Database Service (RDS) is a cloud-native relational database service that is fully managed and eliminates the need for users to manage a database themselves. Amazon RDS facilitates this by automating most management-related operations and letting users control this via the configuration. Among other things, users can scale a database up and down, create multiple instances for high availability, take backups automatically to prevent data loss, and spin up new service instances when one or more fail. This makes concentrating on the business and product easier by outsourcing database management.

In addition to its management features, Amazon RDS also supports several databases, including PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, and Amazon Aurora. Irrespective of the database you want to use, or a combination, you can easily provision them using Amazon RDS.

Even though most of the database management is automated, we still need to keep track of performance to avoid slowing down the system and guarantee the best user experience possible. Amazon RDS enables this by exposing various metrics that you can monitor to understand and track the performance as well as the health of your system. In this article, we will examine a few of these metrics and discuss why you need to monitor them.

Key metrics to monitor in Amazon RDS

The following are some of the key metrics to monitor for the Amazon RDS database service to function smoothly. Also, some of these metrics can help improve and optimize your code’s performance via the database’s usage patterns and how your queries are performing.

Free memory

This metric tells us the available memory for the queries to run. Each of the supported database systems has its metric for this. Amazon RDS exposes the free memory metric irrespective of the underlying database system. For example, for MariaDB, MySQL, Oracle, and PostgreSQL, this metric is read from the MemAvailable metric value in the /proc/meminfo file.

Based on this metric, we can see how much memory our queries consume and if we need to reduce memory usage. You can set up Amazon RDS to elastically increase or decrease memory for the database up to a given limit. Because memory usage is part of the billing for RDS, it is wise to keep a check on free memory and optimize your limits to reduce costs.

Database connections

This metric gives us the count or the number of client network connections that are connected to the database. Typically, the actual number of database connections can be higher than this number since the metric doesn't account for a few connections, such as:

  • After sessions are closed and the network connection is disconnected, the database has to clean them up. Any connections not yet cleaned up by the database are not considered in the metric.
  • The database engine may need a few connections for its housekeeping processes. These connections are also not considered.
  • As RDS features parallel execution, this capability requires a few database connections. This number is also not considered because this is considered internal to RDS.
  • For scheduled jobs that run on the database, the engine requires a few connections for the scheduler. These connections are also not counted.

When you configure the maximum number of allowed connections to the database, we should have a few extra connections available for all such requirements. This metric helps you continually understand how many connections you are using so that you can scale them up or down as needed.

CPU utilization

This metric tells us what percentage of the CPU the database is using. For the same workload, this number can vary depending on the underlying database engine. But this should give you a fair idea of how much CPU capacity you actually need versus how much is allocated.

Storage space

This metric, similar to the CPU utilization metric, gives us the amount of storage space available for storing our data. As you store more data, you may need to periodically keep increasing the storage space so that you don't run into "disk full" errors.

Read and write latencies

The read and write latencies indicate the speed of the underlying storage layer. This metric is represented either in seconds or milliseconds. Read latency is the amount of time taken to read a unit of data from the disk, and write latency is the amount of time taken to write a unit of data to the disk. If this is too huge and is affecting the performance of the system, consider upgrading to faster storage devices.

Network receive and transmit throughput

These metrics tell us how much traffic is incoming and outgoing from our Amazon RDS instances. The receive throughput represents the traffic incoming to the database instance. This will include the client or customer traffic as well as Amazon RDS's traffic used for housekeeping and other features, such as replication and AWS RDS monitoring jobs.

The transmit throughput represents the traffic going out from the database instance. Similar to the receive throughput, this includes both the customer traffic and Amazon RDS's own traffic.

These metrics are represented in bytes/second. If this number is too low, it might mean the movement of data into and out of the database instances is too slow. In this case, you might want to upgrade the network interfaces or increase the limits for better performance.

Read and write IOPS

These two metrics denote the average number of disk I/O operations per second. The read input/output operations per second (IOPS) metric gives us the average number of disk read operations per second, and the write IOPS metric tells us the average number of disk write operations per second.

Depending on the workload on the database instance, these numbers have to be relatively high so that they don't cause any slowdown in system performance. If required, you may want to upgrade the storage devices for a better IOPS rate.

Summary

Several key metrics are available in the Amazon Relational Database Service that help you improve the performance of your systems. There are additional metrics you can monitor in Amazon RDS, but the few discussed above are the most important and also the most basic metrics to start with.

Depending on the size of your system and use cases, consider monitoring other metrics as well and keep optimizing both the code and the database configuration for improved performance.

Was this article helpful?
Monitor your AWS environment

AWS Monitoring helps you gain observability into your AWS environment

Related Articles

Write For Us

Write for Site24x7 is a special writing program that supports writers who create content for Site24x7 "Learn" portal. Get paid for your writing.

Write For Us

Write for Site24x7 is a special writing program that supports writers who create content for Site24x7 “Learn” portal. Get paid for your writing.

Apply Now
Write For Us