

# Working with storage for Amazon RDS DB instances
<a name="USER_PIOPS.StorageTypes"></a>

To specify how you want your data stored in Amazon RDS, choose a storage type and provide a storage size when you create or modify a DB instance. Later, you can increase the amount or change the type of storage by modifying the DB instance. For more information about which storage type to use for your workload, see [Amazon RDS storage types](CHAP_Storage.md#Concepts.Storage).

If your instances run RDS for Oracle or RDS for SQL Server, you can add up to three additional volumes to each DB instance. You can choose either gp3 or io2 as the volume type, allowing you to optimize costs and performance based on your data access patterns. The maximum storage capacity of a DB instance that uses additional volumes is 256 TiB.

**Topics**
+ [Viewing storage volume details for your DB instance](rds-storage-viewing.md)
+ [Increasing DB instance storage capacity](USER_PIOPS.ModifyingExisting.md)
+ [Removing additional storage volumes](USER_PIOPS.RemovingAdditionalVolumes.md)
+ [Managing capacity automatically with Amazon RDS storage autoscaling](USER_PIOPS.Autoscaling.md)
+ [Upgrading the storage file system for a DB instance](USER_PIOPS.UpgradeFileSystem.md)
+ [Modifying settings for Provisioned IOPS SSD storage](User_PIOPS.Increase.md)
+ [I/O-intensive storage modifications](USER_PIOPS.IOIntensive.md)
+ [Modifying settings for General Purpose SSD (gp3) storage](USER_PIOPS.gp3.md)
+ [Using a dedicated log volume (DLV)](USER_PIOPS.dlv.md)

# Viewing storage volume details for your DB instance
<a name="rds-storage-viewing"></a>

You can view your storage volume configuration from the AWS Management Console or AWS CLI. This includes details about both your primary storage volume and any additional storage volumes attached to your DB instance.

# Console
<a name="rds-storage-viewing.console"></a>

To view your storage volume configuration from the console:

1. Sign in to the AWS Management Console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose your DB instance.

1. Choose the **Configuration** tab to view details about your storage volumes. The storage information is located in the following sections:
   + **Primary storage**
   + **Additional storage volumes**

   In **Additional storage volumes**, you can choose **Add storage volume** to add another volume.

# CLI
<a name="rds-storage-viewing.cli"></a>

To view your storage volume configuration from the AWS CLI, use the `describe-db-instances` command.

```
aws rds describe-db-instances --db-instance-identifier my-database
```

In the output, find the `AdditionalStorageVolumes` array to view details for the added volumes.

```
    "AdditionalStorageVolumes": [
        {
            "VolumeName": "rdsdbdata2",
            "StorageVolumeStatus": "Not-in-use",
            "AllocatedStorage": 5000,
            "IOPS": 25000,
            "StorageThroughput": 500,
            "StorageType": "gp3"
        }
    ]
```

The `StorageVolumeStatus` field indicates whether the volume is currently in use by your database. A status of `Not-in-use` means the volume is attached but it's not in use by the database engine or an RDS feature.

# Increasing DB instance storage capacity
<a name="USER_PIOPS.ModifyingExisting"></a>

To increase storage capacity for your DB instance, use either of the following techniques:

**Scale up the storage volume**  
Every DB instance has a primary storage volume with a maximum capacity of 64 TiB. You can increase the allocated space on a storage volume by a minimum of 10%. You can't deallocate space.

**Add up to three storage volumes (io2 or gp3)**  
You can increase the total storage capacity of an RDS for Oracle or RDS for SQL Server instance by adding up to three volumes to each DB instance. Each additional volume allocates up to 64 TiB of storage, up to a maximum of 256 TiB per instance.  
For RDS for Oracle DB instances, you can add a storage volume with the minimum storage size of 200 GiB.

You can use the Amazon RDS Management Console, the Amazon RDS API, or the AWS Command Line Interface (AWS CLI) for the preceding techniques. For information about storage limits, see [Amazon RDS DB instance storage](CHAP_Storage.md).

# Scaling up DB instance storage
<a name="USER_PIOPS.ModifyingExisting.ScalingUp"></a>

You can scale up the storage of an existing DB instance by increasing the allocated storage for the primary volume. When you increase the allocated storage, you must increase it by at least 10 percent. If you try to increase the value by less than 10 percent, you get an error. You can't reduce the amount of storage on a volume after you have allocated storage for it.

**Note**  
For RDS for SQL Server DB instances, you can scale storage for only the General Purpose SSD and Provisioned IOPS SSD storage types.

To monitor the amount of free storage for your DB instance so you can respond when necessary, we recommend that you create an Amazon CloudWatch alarm. For more information on setting CloudWatch alarms, see [Using CloudWatch alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/AlarmThatSendsEmail.html).

Scaling storage usually doesn't cause any outage or performance degradation of the DB instance. After you modify the storage size for a DB instance, the status of the DB instance is **storage-optimization**. 

Storage optimization can take several hours. You can't make further storage modifications for either six (6) hours or until storage optimization has completed on the instance, whichever is longer. You can view the storage optimization progress in the AWS Management Console or by using the [describe-db-instances](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instances.html) AWS CLI command.

## Console
<a name="USER_PIOPS.ModifyingExisting.console"></a>

**To increase storage 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/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify.

1. Choose **Modify**.

1. Enter a new value for **Allocated storage**. It must be at least 10% greater than the current value.   
![\[Modify the amount of storage for a DB instance\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/scale-gs2.png)

1. Choose **Continue**.

1. Choose **Apply immediately** in the **Scheduling of modifications** section to apply the storage changes to the DB instance immediately.

   Or choose **Apply during the next scheduled maintenance window** to apply the changes during the next maintenance window.

1. When the settings are as you want them, choose **Modify DB instance**.

## AWS CLI
<a name="USER_PIOPS.ModifyingExisting.cli"></a>

To increase the storage for a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameters:
+ `--allocated-storage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `--apply-immediately` – Use `--apply-immediately` to apply the storage changes immediately.

  Or use `--no-apply-immediately` (the default) to apply the changes during the next maintenance window. An immediate outage occurs when the changes are applied.

The following example scales up the storage for `mydbinstance` to 1,000 GiB and applies the change immediately. The command also migrates the storage volume to gp3 and sets the provisioned IOPS to 6000.

```
aws rds modify-db-instance \
    --db-instance-identifier mydbinstance \
    --allocated-storage 1000 \
    --storage-type gp3 \
    --iops 6000 \
    --apply-immediately
```

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

## RDS API
<a name="USER_PIOPS.ModifyingExisting.api"></a>

To increase storage for a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameters:
+ `AllocatedStorage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `ApplyImmediately` – Set this option to `True` to apply the storage changes immediately. Set this option to `False` (the default) to apply the changes during the next maintenance window. An immediate outage occurs when the changes are applied.

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

# Adding storage volumes
<a name="USER_PIOPS.ModifyingExisting.AdditionalVolumes"></a>

For RDS for Oracle and RDS for SQL Server DB instances, you can add up to three storage volumes to increase your total storage capacity up to 256 TiB per instance. Additional storage volumes allow you to use different storage types (gp3 and io2) to optimize costs and performance based on your data access patterns.

**Note**  
For RDS for Oracle DB instances, you can add a storage volume with the minimum storage size of 200 GiB.

You can add, modify, or remove additional storage volumes using the AWS Management Console or AWS CLI. You can configure the volumes with different allocated storage, IOPS, and throughput settings. For example, you might place high-performance data on an io2 volume and historical data on a gp3 volume.

The additional volumes must use the volume names shown in the following table.


| RDS for Oracle volume name | RDS for SQL Server volume name | 
| --- | --- | 
| rdsdbdata2 | H: | 
| rdsdbdata3 | I: | 
| rdsdbdata4 | J: | 

## Console
<a name="USER_PIOPS.ModifyingExisting.AdditionalVolumes.console"></a>

**To add an additional storage volume to a DB instance**

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

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify.

1. Choose **Modify**.

1. In the **Storage** section, choose **Add additional storage volume**.

1. Configure the additional storage volume:
   + **Volume name** – Choose `rdsdbdata2`, `rdsdbdata3`, or `rdsdbdata4`.
   + **Storage type** – Choose **General Purpose SSD (gp3)** or **Provisioned IOPS SSD (io2)**.
   + **Allocated storage** – Enter the storage size in GiB (minimum 200 GiB).
   + For io2 storage, configure **Provisioned IOPS**.
   + For gp3 storage, optionally configure **Storage throughput**.

1. Choose **Continue**.

1. When the settings are as you want them, choose **Modify DB instance**.

**Important**  
When you are adding an additional storage volume using the `modify-db-instance` operation, the RDS adds the storage volume immediately regardless of the `--no-apply-immediately` parameter. If you have other modifications in the request, RDS applies them based on the schedule modifications. See [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).

## AWS CLI
<a name="USER_PIOPS.ModifyingExisting.AdditionalVolumes.cli"></a>

To add an additional storage volume to a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the `--additional-storage-volumes` as a JSON array specifying the additional storage volumes to add or modify.

The following example adds an additional storage volume named `rdsdbdata2` with 5000 GiB of gp3 storage to `mydbinstance`. 

When you add an additional storage volume, RDS applies the change immediately regardless of the `--no-apply-immediately` parameter.

```
aws rds modify-db-instance \
    --db-instance-identifier mydbinstance \
    --additional-storage-volumes '[
        {
            "VolumeName": "rdsdbdata2",
            "StorageType": "gp3",
            "AllocatedStorage": 5000,
            "StorageThroughput": 725
        }
    ]'
```

## RDS API
<a name="USER_PIOPS.ModifyingExisting.AdditionalVolumes.api"></a>

To add an additional storage volume to a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the `AdditionalStorageVolumes` parameter as an array of additional storage volume specifications.

When you are adding an additional storage volume using the ModifyDBInstance API operation, RDS adds the storage volume immediately regardless of the `ApplyImmediately` option being True or False.

# Removing additional storage volumes
<a name="USER_PIOPS.RemovingAdditionalVolumes"></a>

You can remove additional storage volumes from RDS for Oracle and RDS for SQL Server DB instances when they are no longer needed. Before removing a volume, make sure that you have moved all database files off the volume and that no database objects are referencing it. Verify that the volume status is `Not-in-use`.

**Important**  
You can't remove the primary storage volume. You can only remove additional storage volumes.

## Console
<a name="USER_PIOPS.RemovingAdditionalVolumes.console"></a>

**To remove an additional storage volume from a DB instance**

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

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that includes the volume that you want to remove.

1. Choose **Modify**.

1. In the **Storage** section, locate the additional storage volume that you want to remove.

1. Choose **Remove volume** for the volume you want to delete.
**Note**  
You can only remove volumes with a status of `Not-in-use`. If the volume is still in use, move all database files off the volume.

1. Choose **Continue**.

1. When the settings are as you want them, choose **Modify DB instance**.

## AWS CLI
<a name="USER_PIOPS.RemovingAdditionalVolumes.cli"></a>

To remove an additional storage volume from a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameter:
+ `--additional-storage-volumes` – JSON array specifying the remaining additional storage volumes. Omit the volume you want to remove from this array.

The following example removes the additional storage volume named `rdsdbdata3` from `mydbinstance` by specifying only the remaining volumes and applies the change immediately.

```
aws rds modify-db-instance \
	--db-instance-identifier mydbinstance \
	--additional-storage-volumes '[{ \
		"VolumeName": "rdsdbdata3", \
		"SetForDelete": true
	}]'
```

## RDS API
<a name="USER_PIOPS.RemovingAdditionalVolumes.api"></a>

To remove an additional storage volume from a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameters:
+ `AdditionalStorageVolumes` – Array of additional storage volume specifications for the volumes you want to keep. Omit the volume you want to remove from this array.
+ `ApplyImmediately` – Set this option to `True` to apply the storage changes immediately. Set this option to `False` (the default) to apply the changes during the next maintenance window.

# Managing capacity automatically with Amazon RDS storage autoscaling
<a name="USER_PIOPS.Autoscaling"></a>

If your workload is unpredictable, you can enable storage autoscaling for an Amazon RDS DB instance. To do so, you can use the Amazon RDS console, the Amazon RDS API, or the AWS CLI. 

**Note**  
Storage autoscaling isn't supported for additional storage volumes.

For example, you might use this feature for a new mobile gaming application that users are adopting rapidly. In this case, a rapidly increasing workload might exceed the available database storage. To avoid having to manually scale up database storage, you can use Amazon RDS storage autoscaling. 

With storage autoscaling enabled, when Amazon RDS detects that you are running out of free database space it automatically scales up your storage. Amazon RDS starts a storage modification for an autoscaling-enabled DB instance when these factors apply:
+ Free available space is less than or equal to 10 percent of the allocated storage.
+ The low-storage condition lasts at least five minutes.
+ At least six hours have passed since the last storage modification, or storage optimization has completed on the instance, whichever is longer.

The additional storage is in increments of whichever of the following is greater:
+ 10 GiB
+ 10 percent of currently allocated storage
+ Predicted storage growth exceeding the current allocated storage size in the next 7 hours based on the `FreeStorageSpace` metrics from the past hour. For more information on metrics, see [Monitoring with Amazon CloudWatch](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MonitoringOverview.html#monitoring-cloudwatch).

The maximum storage threshold is the limit that you set for autoscaling the DB instance. It has the following constraints:
+ You must set the maximum storage threshold to at least 10% more than the current allocated storage. We recommend setting it to at least 26% more to avoid receiving an [event notification](USER_Events.Messages.md#RDS-EVENT-0225) that the storage size is approaching the maximum storage threshold.

  For example, if you have DB instance with 1000 GiB of allocated storage, then set the maximum storage threshold to at least 1100 GiB. If you don't, you get an error such as Invalid max storage size for *engine\$1name*. However, we recommend that you set the maximum storage threshold to at least 1260 GiB to avoid the event notification.
+ For a DB instance that uses Provisioned IOPS (io1 or io2 Block Express) storage, the ratio of IOPS to maximum storage threshold (in GiB) must be within a certain range. For more information, see [Provisioned IOPS SSD storage](CHAP_Storage.md#USER_PIOPS).
+ You can't set the maximum storage threshold for autoscaling-enabled instances to a value greater than the maximum allocated storage for the database engine and DB instance class.

  For example, SQL Server Standard Edition on db.m5.xlarge has a default allocated storage for the instance of 20 GiB (the minimum) and a maximum allocated storage of 16,384 GiB. The default maximum storage threshold for autoscaling is 1,000 GiB. If you use this default, the instance doesn't autoscale above 1,000 GiB. This is true even though the maximum allocated storage for the instance is 16,384 GiB.

**Note**  
We recommend that you carefully choose the maximum storage threshold based on usage patterns and customer needs. If there are any aberrations in the usage patterns, the maximum storage threshold can prevent scaling storage to an unexpectedly high value when autoscaling predicts a very high threshold. After a DB instance has been autoscaled, its allocated storage can't be reduced.

**Topics**
+ [Limitations of storage autoscaling](#autoscaling-limitations)
+ [Enabling storage autoscaling for a new DB instance](#USER_PIOPS.EnablingAutoscaling)
+ [Changing the storage autoscaling settings for a DB instance](#USER_PIOPS.ModifyingAutoscaling)
+ [Manually scaling your DB instance down or in](#USER_PIOPS.ScalingDown)
+ [Turning off storage autoscaling for a DB instance](#USER_PIOPS.DisablingAutoscaling)

## Limitations of storage autoscaling
<a name="autoscaling-limitations"></a>

The following limitations apply to storage autoscaling:
+ Autoscaling doesn't occur if the maximum storage threshold would be exceeded by the storage increment.
+ When autoscaling, RDS predicts the storage size for subsequent autoscaling operations. If a subsequent operation is predicted to exceed the maximum storage threshold, then RDS autoscales to the maximum storage threshold.
+ Autoscaling can't completely prevent storage-full situations for large data loads. This is because further storage modifications can't be made for either six (6) hours or until storage optimization has completed on the instance, whichever is longer.

  If you perform a large data load, and autoscaling doesn't provide enough space, the database might remain in the storage-full state for several hours. This can harm the database.
+ If you start a storage scaling operation at the same time that Amazon RDS starts an autoscaling operation, your storage modification takes precedence. The autoscaling operation is canceled.
+ Autoscaling can't decrease the allocated storage. You can't reduce the amount of storage for a DB instance after storage has been allocated.
+ Autoscaling can't be used with magnetic storage.
+ Autoscaling can't be used with the following previous-generation instance classes that have less than 6 TiB of orderable storage: db.m3.large, db.m3.xlarge, and db.m3.2xlarge.
+ Autoscaling operations aren't logged by AWS CloudTrail. For more information on CloudTrail, see [Monitoring Amazon RDS API calls in AWS CloudTrail](logging-using-cloudtrail.md).
+ Autoscaling isn't supported for additional storage volumes. For more information about additional storage volumes, see [Adding storage volumes](USER_PIOPS.ModifyingExisting.AdditionalVolumes.md).

Although automatic scaling helps you to increase storage on your Amazon RDS DB instance dynamically, you should still configure the initial storage for your DB instance to an appropriate size for your typical workload.

## Enabling storage autoscaling for a new DB instance
<a name="USER_PIOPS.EnablingAutoscaling"></a>

When you create a new Amazon RDS DB instance, you can choose whether to enable storage autoscaling. You can also set an upper limit on the storage that Amazon RDS can allocate for the DB instance.

Enabling storage autoscaling doesn't require a database reboot and doesn't cause any downtime. The feature takes effect immediately without disrupting database operations.

**Note**  
When you clone an Amazon RDS DB instance that has storage autoscaling enabled, that setting isn't automatically inherited by the cloned instance. The new DB instance has the same amount of allocated storage as the original instance. You can turn storage autoscaling on again for the new instance if the cloned instance continues to increase its storage requirements.

### Console
<a name="USER_PIOPS.EnablingAutoscaling.console"></a>

**To enable storage autoscaling for a new DB instance**

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

1.  In the upper-right corner of the Amazon RDS console, choose the AWS Region where you want to create the DB instance. 

1.  In the navigation pane, choose **Databases**. 

1.  Choose **Create database**. On the **Select engine** page, choose your database engine and specify your DB instance information as described in [Getting started with Amazon RDS](CHAP_GettingStarted.md). 

1. In the **Storage autoscaling** section, set the **Maximum storage threshold** value for the DB instance. 

1. Specify the rest of your DB instance information as described in [Getting started with Amazon RDS](CHAP_GettingStarted.md).

### AWS CLI
<a name="USER_PIOPS.EnablingAutoscaling.cli"></a>

To enable storage autoscaling for a new DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html). Set the following parameter:
+  `--max-allocated-storage` – Turns on storage autoscaling and sets the upper limit on storage size, in gibibytes.

 To verify that Amazon RDS storage autoscaling is available for your DB instance, use the AWS CLI [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-valid-db-instance-modifications.html](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-valid-db-instance-modifications.html) command. To check based on the instance class before creating an instance, use the [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-orderable-db-instance-options.html](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-orderable-db-instance-options.html) command. Check the following field in the return value: 
+  `SupportsStorageAutoscaling` – Indicates whether the DB instance or instance class supports storage autoscaling. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

### RDS API
<a name="USER_PIOPS.EnablingAutoscaling.api"></a>

To enable storage autoscaling for a new DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html). Set the following parameter:
+  `MaxAllocatedStorage` – Turns on Amazon RDS storage autoscaling and sets the upper limit on storage size, in gibibytes. 

 To verify that Amazon RDS storage autoscaling is available for your DB instance, use the Amazon RDS API [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeValidDbInstanceModifications.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeValidDbInstanceModifications.html) operation for an existing instance, or the [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeOrderableDBInstanceOptions.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeOrderableDBInstanceOptions.html) operation before creating an instance. Check the following field in the return value: 
+  `SupportsStorageAutoscaling` – Indicates whether the DB instance supports storage autoscaling. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

## Changing the storage autoscaling settings for a DB instance
<a name="USER_PIOPS.ModifyingAutoscaling"></a>

You can turn storage autoscaling on for an existing Amazon RDS DB instance. You can also change the upper limit on the storage that Amazon RDS can allocate for the DB instance. 

Changing storage autoscaling settings doesn't require a database reboot and doesn't cause any downtime. The changes take effect immediately without disrupting database operations.

### Console
<a name="USER_PIOPS.ModifyingAutoscaling.console"></a>

**To change the storage autoscaling settings 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/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify, and choose **Modify**. The **Modify DB instance** page appears. 

1.  Change the storage limit in the **Autoscaling** section. For more information, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md). 

1.  When all the changes are as you want them, choose **Continue** and check your modifications. 

1.  On the confirmation page, review your changes. If they're correct, choose **Modify DB instance** to save your changes. If they aren't correct, choose **Back** to edit your changes or **Cancel** to cancel your changes.

   Changing the storage autoscaling limit occurs immediately. This setting ignores the **Apply immediately** setting.

### AWS CLI
<a name="USER_PIOPS.ModifyingAutoscaling.cli"></a>

To change the storage autoscaling settings for a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameter: 
+  `--max-allocated-storage` – Sets the upper limit on storage size, in gibibytes. If the value is greater than the `--allocated-storage` parameter, storage autoscaling is turned on. If the value is the same as the `--allocated-storage` parameter, storage autoscaling is turned off. 

 To verify that Amazon RDS storage autoscaling is available for your DB instance, use the AWS CLI [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-valid-db-instance-modifications.html](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-valid-db-instance-modifications.html) command. To check based on the instance class before creating an instance, use the [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-orderable-db-instance-options.html](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-orderable-db-instance-options.html) command. Check the following field in the return value: 
+  `SupportsStorageAutoscaling` – Indicates whether the DB instance supports storage autoscaling. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

### RDS API
<a name="USER_PIOPS.ModifyingAutoscaling.api"></a>

 To change the storage autoscaling settings for a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameter: 
+  `MaxAllocatedStorage` – Sets the upper limit on storage size, in gibibytes. 

 To verify that Amazon RDS storage autoscaling is available for your DB instance, use the Amazon RDS API [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeValidDbInstanceModifications.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeValidDbInstanceModifications.html) operation for an existing instance, or the [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeOrderableDBInstanceOptions.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeOrderableDBInstanceOptions.html) operation before creating an instance. Check the following field in the return value: 
+  `SupportsStorageAutoscaling` – Indicates whether the DB instance supports storage autoscaling. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

## Manually scaling your DB instance down or in
<a name="USER_PIOPS.ScalingDown"></a>

Amazon RDS provides storage autoscaling to meet growing demand. However, there are limitations regarding scaling down and in:
+ **RDS storage** – While RDS supports automatic scaling up of storage as demand increases, it doesn't automatically scale down. 
+ **Read replicas** – RDS doesn't support automatic scaling out (adding) or scaling in (deleting) of read replicas. You must manually add or remove read replicas according to your load requirements.

To scale down your RDS resources, perform the following manual actions:
+ For storage, you can't manually reduce the allocated storage of a DB instance using the `modify-db-instance` command. Instead, choose one of the following techniques:
  + Use a blue/green deployment if your DB engine supports it. Create a green database with a lower storage size, and then promote your green database to be your blue database. For more information, see [Modify storage and performance settings](blue-green-deployments-creating.md#blue-green-deployments-resize).
  + Create a new DB instance with lower allocated storage, manually migrate the data from your current database to the newly created database instance, and switch your database endpoints.
+ For read replicas, manually delete any unused replicas through the RDS console or AWS CLI.

## Turning off storage autoscaling for a DB instance
<a name="USER_PIOPS.DisablingAutoscaling"></a>

 If you no longer need Amazon RDS to automatically increase the storage for an Amazon RDS DB instance, you can turn off storage autoscaling. After you do, you can still manually increase the amount of storage for your DB instance. 

### Console
<a name="USER_PIOPS.DisablingAutoscaling.console"></a>

**To turn off storage autoscaling 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/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify and choose **Modify**. The **Modify DB instance** page appears. 

1.  Clear the **Enable storage autoscaling** check box in the **Storage autoscaling** section. For more information, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md). 

1.  When all the changes are as you want them, choose **Continue** and check the modifications.

1. On the confirmation page, review your changes. If they're correct, choose **Modify DB instance** to save your changes. If they aren't correct, choose **Back** to edit your changes or **Cancel** to cancel your changes.

Changing the storage autoscaling limit occurs immediately. This setting ignores the **Apply immediately** setting.

### AWS CLI
<a name="USER_PIOPS.DisablingAutoscaling.cli"></a>

 To turn off storage autoscaling for a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) and the following parameter: 
+  `--max-allocated-storage` – Specify a value equal to the `--allocated-storage` setting to prevent further Amazon RDS storage autoscaling for the specified DB instance. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

### RDS API
<a name="USER_PIOPS.DisablingAutoscaling.api"></a>

 To turn off storage autoscaling for a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameter:
+  `MaxAllocatedStorage` – Specify a value equal to the `AllocatedStorage` setting to prevent further Amazon RDS storage autoscaling for the specified DB instance. 

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

# Upgrading the storage file system for a DB instance
<a name="USER_PIOPS.UpgradeFileSystem"></a>

Most RDS DB instances offer a maximum storage size of 64 TiB for RDS for MariaDB, MySQL, and PostgreSQL databases. However, some older 32-bit file systems have lower storage capacities. To determine the storage capacity of your DB instance, use the [describe-valid-db-instance-modifications](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-valid-db-instance-modifications.html) AWS CLI command.

RDS checks whether your storage system has a 16 TiB storage size, a file size limit of 2 TiB, or non-optimized writes. If your DB instances meet these conditions, RDS alerts you that your file system configuration is eligible for an upgrade. You can check the upgrade eligibility of a DB instance on the **Storage** panel of the DB instance details page.

![\[Check the storage configuration upgrade eligibility of a DB instance.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/upgrade-storage-config.png)


If your DB instance is eligible for a file system upgrade, use either of the following techniques:
+ Create a blue/green deployment and specify **Upgrade storage file system configuration**. 

  This option upgrades the file system in the green environment to the preferred configuration. You can then switch over the blue/green deployment, which promotes the green environment to be the new production environment. For detailed instructions, see [Creating a blue/green deployment in Amazon RDS](blue-green-deployments-creating.md).
+ Create a DB instance read replica and specify **Upgrade storage file system configuration**. 

  This option upgrades the file system of the read replica to the preferred configuration. You can then promote the read replica to be a standalone instance. For detailed instructions, see [Creating a read replica](USER_ReadRepl.Create.md).

During the storage upgrade, your database engine isn't available. Upgrading the storage configuration is an I/O-intensive operation and leads to longer creation times for read replicas and blue/green deployments. The storage upgrade process is faster when both of the following conditions are met:
+ The source DB instance uses Provisioned IOPS SSD (io1 or io2 Block Express) storage.
+ You provisioned the green environment or read replica with an instance size of 4xlarge or larger.

Storage upgrades involving General Purpose SSD (gp2) storage can deplete your I/O credit balance, resulting in longer upgrade times. For more information, see [Amazon RDS DB instance storage](CHAP_Storage.md).

During a storage upgrade, RDS increases the allocated storage size by 10% for the green instance or read replica if both of the following conditions are met:
+ The storage consumption on your source DB instance is greater than or equal to 90% of the allocated storage size.
+ Storage autoscaling is enabled.

RDS turns off autoscaling when the new storage size is greater than or equal to the maximum allocated storage that was set for the instance. If storage autoscaling is disabled before the storage upgrade begins, the storage size doesn't increase during the upgrade.

# Modifying settings for Provisioned IOPS SSD storage
<a name="User_PIOPS.Increase"></a>

You can modify the settings for a DB instance that uses Provisioned IOPS SSD storage by using the Amazon RDS console, AWS CLI, or Amazon RDS API. Specify the storage type, allocated storage, and the amount of Provisioned IOPS that you require. The range depends on your database engine and instance type.

Although you can reduce the amount of IOPS provisioned for your instance, you can't reduce the storage size.

In most cases, scaling storage doesn't require any outage and doesn't degrade performance of the server. After you modify the storage IOPS for a DB instance, the status of the DB instance is **storage-optimization**.

**Note**  
Storage optimization can take several hours. You can't make further storage modifications for either six (6) hours or until storage optimization has completed on the instance, whichever is longer.

For information on the ranges of allocated storage and Provisioned IOPS available for each database engine, see [Provisioned IOPS SSD storage](CHAP_Storage.md#USER_PIOPS).

## Console
<a name="User_PIOPS.Increase.con"></a>

**To change the Provisioned IOPS settings 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/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

   To filter the list of DB instances, for **Filter databases** enter a text string for Amazon RDS to use to filter the results. Only DB instances whose names contain the string appear.

1. Choose the DB instance with Provisioned IOPS that you want to modify.

1. Choose **Modify**.

1. On the **Modify DB instance** page, choose **Provisioned IOPS SSD (io1)** or **Provisioned IOPS SSD (io2)** for **Storage type**.

1. For **Provisioned IOPS**, enter a value.

   If the value that you specify for either **Allocated storage** or **Provisioned IOPS** is outside the limits supported by the other parameter, a warning message is displayed. This message gives the range of values required for the other parameter. 

1. Choose **Continue**.

1. Choose **Apply immediately** in the **Scheduling of modifications** section to apply the changes to the DB instance immediately. Or choose **Apply during the next scheduled maintenance window** to apply the changes during the next maintenance window.

1. Review the parameters to be changed, and choose **Modify DB instance** to complete the modification.

   The new value for allocated storage or for Provisioned IOPS appears in the **Status** column. 

## AWS CLI
<a name="User_PIOPS.Increase.cli"></a>

To change the Provisioned IOPS setting for a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameters:
+ `--storage-type` – Set to `io1` or `io2` for Provisioned IOPS.
+ `--allocated-storage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `--iops` – The new amount of Provisioned IOPS for the DB instance, expressed in I/O operations per second.
+ `--apply-immediately` – Use `--apply-immediately` to apply changes immediately. Use `--no-apply-immediately` (the default) to apply changes during the next maintenance window.

## RDS API
<a name="User_PIOPS.Increase.api"></a>

To change the Provisioned IOPS settings for a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameters:
+ `StorageType` – Set to `io1` or `io2` for Provisioned IOPS.
+ `AllocatedStorage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `Iops` – The new IOPS rate for the DB instance, expressed in I/O operations per second.
+ `ApplyImmediately` – Set this option to `True` to apply changes immediately. Set this option to `False` (the default) to apply changes during the next maintenance window.

# I/O-intensive storage modifications
<a name="USER_PIOPS.IOIntensive"></a>

Amazon RDS DB instances use Amazon Elastic Block Store (EBS) volumes for database and log storage. Depending on the amount of storage requested, RDS (except for RDS for SQL Server) automatically *stripes* across multiple Amazon EBS volumes to enhance performance. RDS DB instances with SSD storage types are backed by either one or four striped Amazon EBS volumes in a RAID 0 configuration. By design, storage modification operations for an RDS DB instance have minimal impact on ongoing database operations.

In most cases, storage scaling modifications are completely offloaded to the Amazon EBS layer and are transparent to the database. This process is typically completed within a few minutes. However, some older RDS storage volumes require a different process for modifying the size, Provisioned IOPS, or storage type. This involves making a full copy of the data using a potentially I/O-intensive operation.

Storage modification uses an I/O-intensive operation if any of the following factors apply:
+ The source storage type is magnetic. Magnetic storage doesn't support elastic volume modification.
+ The RDS DB instance isn't on a one- or four-volume Amazon EBS layout. You can view the number of Amazon EBS volumes in use on your RDS DB instances by using Enhanced Monitoring metrics. For more information, see [Viewing OS metrics in the RDS console](USER_Monitoring.OS.Viewing.md).
+ The target size of the modification request increases the allocated storage above 400 GiB for RDS for MariaDB, MySQL, and PostgreSQL instances, and 200 GiB for RDS for Oracle. Storage autoscaling operations have the same effect when they increase the allocated storage size of your DB instance above these thresholds.

If your storage modification involves an I/O-intensive operation, it consumes I/O resources and increases the load on your DB instance. Storage modifications with I/O-intensive operations involving General Purpose SSD (gp2) storage can deplete your I/O credit balance, resulting in longer conversion times.

We recommend as a best practice to schedule these storage modification requests outside of peak hours to help reduce the time required to complete the storage modification operation. Alternatively, you can create a read replica of the DB instance and perform the storage modification on the read replica. Then promote the read replica to be the primary DB instance. For more information, see [Working with DB instance read replicas](USER_ReadRepl.md).

For more information, see [Why is an Amazon RDS DB instance stuck in the modifying state when I try to increase the allocated storage?](https://aws.amazon.com/premiumsupport/knowledge-center/rds-stuck-modifying/)

# Modifying settings for General Purpose SSD (gp3) storage
<a name="USER_PIOPS.gp3"></a>

You can modify the settings for a DB instance that uses General Purpose SSD (gp3) storage by using the Amazon RDS console, AWS CLI, or Amazon RDS API. Specify the storage type, allocated storage, amount of Provisioned IOPS, and storage throughput that you require.

Although you can reduce the amount of Provisioned IOPS and storage throughput for your DB instance, you can't reduce the storage size.

In most cases, scaling storage doesn't require any outage. After you modify the storage IOPS for a DB instance, the status of the DB instance is **storage-optimization**. You can expect elevated latencies, but still within the single-digit millisecond range, during storage optimization. The DB instance is fully operational after a storage modification.

**Note**  
You can't make further storage modifications until six (6) hours after storage optimization has completed on the instance.

For information on the ranges of allocated storage, Provisioned IOPS, and storage throughput available for each database engine, see [gp3 storage (recommended)](CHAP_Storage.md#gp3-storage).

## Console
<a name="USER_PIOPS.gp3.Console"></a>

**To change the storage performance settings 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/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

   To filter the list of DB instances, for **Filter databases** enter a text string for Amazon RDS to use to filter the results. Only DB instances whose names contain the string appear.

1. Choose the DB instance with gp3 storage that you want to modify.

1. Choose **Modify**.

1. On the **Modify DB instance page**, choose **General Purpose SSD (gp3)** for **Storage type**, then do the following:

   1. For **Provisioned IOPS**, choose a value.

      If the value that you specify for either **Allocated storage** or **Provisioned IOPS** is outside the limits supported by the other parameter, a warning message appears. This message gives the range of values required for the other parameter.

   1. For **Storage throughput**, choose a value.

      If the value that you specify for either **Provisioned IOPS** or **Storage throughput** is outside the limits supported by the other parameter, a warning message appears. This message gives the range of values required for the other parameter.

1. Choose **Continue**.

1. Choose **Apply immediately** in the **Scheduling of modifications** section to apply the changes to the DB instance immediately. Or choose **Apply during the next scheduled maintenance window** to apply the changes during the next maintenance window.

1. Review the parameters to be changed, and choose **Modify DB instance** to complete the modification.

   The new value for Provisioned IOPS appears in the **Status** column.

## AWS CLI
<a name="USER_PIOPS.gp3.CLI"></a>

To change the storage performance settings for a DB instance, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameters:
+ `--storage-type` – Set to `gp3` for General Purpose SSD (gp3).
+ `--allocated-storage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `--iops` – The new amount of Provisioned IOPS for the DB instance, expressed in I/O operations per second.
+ `--storage-throughput` – The new storage throughput for the DB instance, expressed in MiBps.
+ `--apply-immediately` – Use `--apply-immediately` to apply changes immediately. Use `--no-apply-immediately` (the default) to apply changes during the next maintenance window.

## RDS API
<a name="USER_PIOPS.gp3.API"></a>

To change the storage performance settings for a DB instance, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameters:
+ `StorageType` – Set to `gp3` for General Purpose SSD (gp3).
+ `AllocatedStorage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `Iops` – The new IOPS rate for the DB instance, expressed in I/O operations per second.
+ `StorageThroughput` – The new storage throughput for the DB instance, expressed in MiBps.
+ `ApplyImmediately` – Set this option to `True` to apply changes immediately. Set this option to `False` (the default) to apply changes during the next maintenance window.

# Using a dedicated log volume (DLV)
<a name="USER_PIOPS.dlv"></a>

You can use a dedicated log volume (DLV) for a DB instance that uses Provisioned IOPS (PIOPS) storage. A DLV moves PostgreSQL database transaction logs and MySQL/MariaDB redo logs and binary logs to a storage volume that's separate from the volume containing the database tables. A DLV makes transaction write logging more efficient and consistent. DLVs are ideal for databases with large allocated storage, high I/O per second (IOPS) requirements, or latency-sensitive workloads.

DLVs are supported for PIOPS storage (io1 and io2 Block Express) and are created with a fixed size of 1,024 GiB and 3,000 Provisioned IOPS.

Amazon RDS supports DLVs in all AWS Regions for the following versions:
+ MariaDB 10.6.7 and higher 10 versions
+ MySQL 8.0.28 and higher 8.0 versions, MySQL 8.4.3 and higher 8.4 versions
+ PostgreSQL 13.10 and higher 13 versions, 14.7 and higher 14 versions, and 15.2 and higher 15 versions

RDS supports DLVs with Multi-AZ deployments. When you modify or create a Multi-AZ instance, a DLV is created for both the primary and the secondary.

RDS supports DLVs with read replicas. If the primary DB instance has a DLV enabled, all read replicas created after enabling DLV will also have a DLV. Any read replicas created before the switch to DLV will not have it enabled unless explicitly modified to do so. We recommend all read replicas attached to a primary instance before DLV was enabled also be manually modified to have A DLV.

**Note**  
We recommend DLVs for database configurations of 5 TiB or greater.

For more information on the benefits of DLVs, see the following blog posts:
+ [Enhance database performance with Amazon RDS dedicated log volumes](https://aws.amazon.com/blogs/database/enhance-database-performance-with-amazon-rds-dedicated-log-volumes/)
+ [Benchmark Amazon RDS for PostgreSQL with dedicated log volumes](https://aws.amazon.com/blogs/database/benchmark-amazon-rds-for-postgresql-with-dedicated-log-volumes/)
+ [Maximizing performance of AWS RDS for MySQL with dedicated log volumes](https://www.percona.com/blog/maximizing-performance-of-aws-rds-for-mysql-with-dedicated-log-volumes/) in the Percona documentation

For information on the ranges of allocated storage, Provisioned IOPS, and storage throughput available for each database engine, see [Provisioned IOPS SSD storage](CHAP_Storage.md#USER_PIOPS).

**Topics**
+ [Considerations when enabling and disabling DLV](#USER_PIOPS.dlv.considerations)
+ [Enabling DLV when you create a DB instance](#USER_PIOPS.create-dlv)
+ [Enabling DLV on an existing DB instance](#USER_PIOPS.modify-dlv)
+ [Monitoring DLV storage](#USER_PIOPS.dlv.monitoring)

## Considerations when enabling and disabling DLV
<a name="USER_PIOPS.dlv.considerations"></a>

Enabling and disabling DLV can be time consuming and cause downtime. The process involves copying all transaction logs or redo and binary logs (depending on the database engine) to the new volume when enabling, or back to the original storage when disabling. The duration of this operation is influenced by several factors:
+ Number of transaction logs:
  + Larger databases with more transactions generate more logs, increasing the time required for copying.
  + Transaction logs can accumulate on the primary DB instance if replication slots are inactive or if replication is lagging, increasing the time required for copying. Make sure that replication is current, and remove any unnecessary slots.
+ Storage configuration:
  + DB instance EBS bandwidth – Higher bandwidth allows for faster data transfer.
  + Number of Provisioned IOPS – More input/output operations per second (IOPS) can speed up the copying process.
+ Database activity – High levels of database activity during configuration can slow down the process.

To minimize downtime, we recommend that you plan and schedule during periods of low activity or maintenance windows.

## Enabling DLV when you create a DB instance
<a name="USER_PIOPS.create-dlv"></a>

You can use the AWS Management Console, AWS CLI, or RDS API to create a DB instance with DLV enabled.

### Console
<a name="USER_PIOPS.create-dlv.CON"></a>

**To enable DLV on a new DB instance**

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

1. Choose **Create database**.

1. On the **Create DB instance page**, choose a DB engine that supports DLV.

1. For **Storage**:

   1. Choose either **Provisioned IOPS SSD (io1)** or **Provisioned IOPS SSD (io2)**.

   1. Enter the **Allocated storage** and **Provisioned IOPS** that you want.

   1. Expand **Dedicated Log Volume**, then select **Turn on Dedicated Log Volume**.  
![\[Enabling DLV on a new DB instance.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/enable-dlv.png)

1. Choose other settings as needed.

1. Choose **Create database**.

After the database is created, the value for Dedicated Log Volume appears on the **Configuration** tab of the database details page.

### CLI
<a name="USER_PIOPS.create-dlv.CLI"></a>

To enable DLV when you create a DB instance using Provisioned IOPS storage, use the AWS CLI command [create-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html). Set the following parameters:
+ `--dedicated-log-volume` – Enables a dedicated log volume.
+ `--storage-type` – Set to `io1` or `io2` for Provisioned IOPS.
+ `--allocated-storage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `--iops` – The amount of Provisioned IOPS for the DB instance, expressed in I/O operations per second.

### RDS API
<a name="USER_PIOPS.create-dlv.API"></a>

To enable DLV when you create a DB instance using Provisioned IOPS storage, use the Amazon RDS API operation [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CretaeDBInstance.html). Set the following parameters:
+ `DedicatedLogVolume` – Set to `true` to enable a dedicated log volume.
+ `StorageType` – Set to `io1` or `io2` for Provisioned IOPS.
+ `AllocatedStorage` – Amount of storage to be allocated for the DB instance, in gibibytes.
+ `Iops` – The IOPS rate for the DB instance, expressed in I/O operations per second.

## Enabling DLV on an existing DB instance
<a name="USER_PIOPS.modify-dlv"></a>

You can use the AWS Management Console, AWS CLI, or RDS API to modify a DB instance to enable DLV.

After you modify the DLV setting for a DB instance, you must reboot the DB instance.

### Console
<a name="USER_PIOPS.modify-dlv.CON"></a>

**To enable DLV on an existing DB instance**

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

1. In the navigation pane, choose **Databases**.

   To filter the list of DB instances, for **Filter databases** enter a text string for Amazon RDS to use to filter the results. Only DB instances whose names contain the string appear.

1. Choose the DB instance with Provisioned IOPS storage that you want to modify.

1. Choose **Modify**.

1. On the **Modify DB instance page**:

   1. For **Storage**, expand **Dedicated Log Volume**, then select **Turn on Dedicated Log Volume**.

1. Choose **Continue**.

1. Choose **Apply immediately** to apply the changes to the DB instance immediately. Or choose **Apply during the next scheduled maintenance window** to apply the changes during the next maintenance window.

1. Review the parameters to be changed, and choose **Modify DB instance** to complete the modification.

The new value for Dedicated Log Volume appears on the **Configuration** tab of the database details page.

### CLI
<a name="USER_PIOPS.modify-dlv.CLI"></a>

To enable or disable DLV on an existing DB instance using Provisioned IOPS storage, use the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html). Set the following parameters:
+ `--dedicated-log-volume` – Enables a dedicated log volume.

  Use `--no-dedicated-log-volume` (the default) to disable a dedicated log volume.
+ `--apply-immediately` – Use `--apply-immediately` to apply changes immediately.

  Use `--no-apply-immediately` (the default) to apply changes during the next maintenance window.

### RDS API
<a name="USER_PIOPS.modify-dlv.API"></a>

To enable or disable DLV on an existing DB instance using Provisioned IOPS storage, use the Amazon RDS API operation [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). Set the following parameters:
+ `DedicatedLogVolume` – Set this option to `true` to enable a dedicated log volume.

  Set this option to `false` to disable a dedicated log volume. This is the default value.
+ `ApplyImmediately` – Set this option to `True` to apply changes immediately.

  Set this option to `False` (the default) to apply changes during the next maintenance window.

## Monitoring DLV storage
<a name="USER_PIOPS.dlv.monitoring"></a>

You can monitor the DLV storage usage by using the `FreeStorageSpaceLogVolume` metric in CloudWatch.

You can use the following query for RDS for PostgreSQL to find the size occupied by transaction logs:

```
SELECT pg_size_pretty(COALESCE(sum(size), 0)) AS total_wal_generated_size
FROM pg_catalog.pg_ls_waldir();
```

If the DLV runs out of storage, the DB instance will enter the `storage-full` state, causing downtime.