How do I minimize downtime during required Amazon RDS maintenance?

4 minute read
0

One of my Amazon Relational Database Service (Amazon RDS) DB instances requires maintenance, and I want to minimize downtime.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Occasionally, AWS performs maintenance to the hardware, operating system (OS), or database engine version for a DB instance or cluster. For more information, see Maintaining a DB instance and Upgrading a DB instance engine version.

For information about pending maintenance events for your Amazon RDS DB instances, check the Events pane of the Amazon RDS console. Then, check for engine-specific maintenance events. You can use the AWS CLI to run describe-pending-maintenance-actions or the Amazon RDS API for DescribeDBInstances. For more information, see Viewing pending maintenance.

Hardware maintenance

Before Amazon RDS schedules maintenance, you receive an email notification about the scheduled maintenance windows. This includes the time of the maintenance and the Availability Zones that are affected. During hardware maintenance, Single-AZ deployments are unavailable for a few minutes. For Multi-AZ deployments with an affected Availability Zone, your deployment is unavailable for the time it takes the instance to fail over, usually about 60 seconds. If maintenance affects only the secondary Availability Zone, then there's no failover or downtime.

OS maintenance

To postpone scheduled OS maintenance, adjust your preferred maintenance window. Or, you can choose Defer upgrade from the Actions dropdown menu in the Amazon RDS console. To minimize downtime, modify the Amazon RDS DB instance to a Multi-AZ deployment. For Multi-AZ deployments, OS maintenance applies to the secondary instance. The instance fails over, and then the primary instance updates. The downtime is during failover. For more information, see Maintenance for Multi-AZ deployments.

Note: If you upgrade to a Multi-AZ deployment, then you incur higher costs. To determine your costs, use the AWS Pricing Calculator.

When you upgrade your DB instance's database engine in a Multi-AZ deployment, maintenance occurs on the primary and replica instance at the same time. This is also true for non-Amazon Aurora instances in Multi-AZ deployments. Throughout the maintenance window, both the primary and secondary DB instances in the Multi-AZ deployment are unavailable. This operation causes downtime until the upgrade is complete. The duration of the downtime varies based on the size of your DB instance.

If the instance is a read replica, then the database engine version upgrade occurs independently from the source instance. By default, maintenance occurs first on the primary instance and then on the replica. 

DB engine maintenance

Upgrades to the database engine level require downtime. Even if your RDS DB instance uses a Multi-AZ deployment, both the primary and standby DB instances upgrade at the same time. This causes downtime until the upgrade completes, and the duration of the downtime varies based on the size of your DB instance. For more information, check the documentation for your DB engine in Upgrading a DB instance engine version.

Note: If you upgrade a SQL Server DB instance in a Multi-AZ deployment, then both the primary and standby instances are upgraded. Amazon RDS performs rolling upgrades, so the outage is only for the duration of a failover. For more information, see Multi-AZ and in-memory optimization considerations.

Related information

Best practices for Amazon RDS

Using a read replica to reduce downtime when upgrading a MySQL database

What happens to Amazon RDS and Amazon Redshift queries that are running during a maintenance window?

How do I configure notifications for Amazon RDS or Amazon Redshift maintenance windows?

2 Comments

DB engine maintenance Upgrades to the database engine level require downtime. Even if your RDS DB instance uses a Multi-AZ deployment, both the primary and standby DB instances are upgraded at the same time. VS https://aws.amazon.com/rds/features/read-replicas/ Non-Aurora: database engine version upgrades happen on primary; Aurora: all instances are updated together

Please clarify

Manish
replied 5 months ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERATOR
replied 5 months ago