RDS Running Out of Storage: Enable Storage Autoscaling Without Downtime
When an RDS instance runs out of storage, writes fail and applications go down — enabling RDS Storage Autoscaling is the fastest path to preventing that crisis.
TL;DR: RDS Storage Autoscaling at a Glance
| Concern | Answer |
|---|---|
| Causes downtime? | No — scaling happens online |
| How to enable? | Set MaxAllocatedStorage > AllocatedStorage |
| How to disable? | Set MaxAllocatedStorage = AllocatedStorage |
| Trigger condition | Free space < 10% of allocated AND < 64 GiB AND low for 5+ minutes |
| Scale increment | Larger of: 5 GiB, 10% of current storage, or 7-hour projected usage |
| Hard ceiling | Your configured MaxAllocatedStorage value |
| Supported engines | MySQL, MariaDB, PostgreSQL, SQL Server, Oracle on RDS |
Why RDS Storage Autoscaling Exists — and Why Engineers Miss It
Here is the thought process most engineers have when they first see storage warnings: "I'll just modify the instance and bump the allocated storage manually — how hard can it be?" Then they discover that manual storage increases on RDS can trigger a multi-hour maintenance window depending on the storage type and engine, and suddenly a 3 AM alert becomes a 3 AM incident. Storage Autoscaling was built precisely to eliminate that reactive scramble.
The feature works by monitoring free storage continuously. When free space drops below a threshold, RDS automatically expands the underlying volume — no manual intervention, no maintenance window, no application restart.
Autoscaling only ever increases storage. It never shrinks it.
The Exact Trigger Condition for RDS Storage Autoscaling
This is where most documentation summaries fall short. RDS Storage Autoscaling fires when ALL three of the following conditions are simultaneously true:
- Free available space is less than 10% of the currently allocated storage
- Free available space is less than 64 GiB
- The low-storage condition has persisted for at least 5 minutes
The 5-minute persistence window is the non-obvious part. A brief spike in write activity that temporarily consumes space will not trigger autoscaling if free space recovers within that window. This prevents unnecessary expansions from transient workloads — but it also means you cannot rely on autoscaling as a last-second safety net if your storage drains rapidly.
The 64 GiB upper bound on the free-space check matters for large instances. On a 2 TiB volume, 10% is 204 GiB — but autoscaling will not trigger until free space drops below 64 GiB, whichever threshold is hit first.
How the Scale Increment Is Calculated
When autoscaling triggers, RDS calculates the new target size as the largest of three values:
- Current allocated storage + 5 GiB
- Current allocated storage + 10% of current allocated storage
- Current allocated storage + 7 hours of projected storage consumption (based on the rate observed over the past hour)
The projection-based option is what makes this genuinely useful in practice. If your database is ingesting data at a high rate, RDS will scale ahead of the immediate threshold rather than just barely clearing it — reducing the chance of a second autoscaling event minutes later.
Think of it like a fuel gauge with a smart pump: it does not just add enough fuel to get off empty — it estimates how far you are driving and fills accordingly.
Enabling RDS Storage Autoscaling: Console and CLI
Autoscaling is controlled entirely by the relationship between two parameters: AllocatedStorage (current size) and MaxAllocatedStorage (the ceiling). When MaxAllocatedStorage is greater than AllocatedStorage, autoscaling is active. There is no separate on/off toggle — the ceiling value is the switch.
AWS Console
Navigate to RDS → Databases → [your instance] → Modify. Under the Storage section, check Enable storage autoscaling and set a Maximum storage threshold. Apply immediately or during the next maintenance window — enabling autoscaling itself does not cause downtime.
AWS CLI
🔽 Click to expand: Enable autoscaling via CLI
aws rds modify-db-instance \
--db-instance-identifier my-production-db \
--max-allocated-storage 500 \
--apply-immediately
In this example, if AllocatedStorage is currently 100 GiB, setting --max-allocated-storage 500 enables autoscaling with a 500 GiB ceiling. RDS will expand the volume automatically as needed, up to that limit.
Verify the Current Configuration
aws rds describe-db-instances \
--db-instance-identifier my-production-db \
--query 'DBInstances[0].{Allocated:AllocatedStorage,MaxAllocated:MaxAllocatedStorage}'
If MaxAllocatedStorage equals AllocatedStorage in the output, autoscaling is effectively disabled — RDS has no headroom to expand into.
Disabling RDS Storage Autoscaling
To disable autoscaling, set MaxAllocatedStorage equal to the current AllocatedStorage value. This removes the expansion headroom and prevents any further automatic growth. There is no separate disable flag or console toggle — the equality of these two values is what disables the feature.
🔽 Click to expand: Disable autoscaling via CLI
# First, retrieve the current AllocatedStorage value
aws rds describe-db-instances \
--db-instance-identifier my-production-db \
--query 'DBInstances[0].AllocatedStorage'
# Then set MaxAllocatedStorage equal to that value
aws rds modify-db-instance \
--db-instance-identifier my-production-db \
--max-allocated-storage 100 \
--apply-immediately
Replace 100 with whatever AllocatedStorage currently reports. Once they are equal, RDS will not expand storage automatically, even if free space drops below the trigger threshold.
Decision Flow: Should You Enable Autoscaling Now?
- Check current usage — if free space is already below 10% or 64 GiB, enable autoscaling immediately and consider a manual increase in parallel.
- Assess growth rate — steady linear growth is ideal for autoscaling; sudden bulk loads may drain storage faster than the 5-minute trigger window allows.
- Set a realistic ceiling —
MaxAllocatedStorageshould reflect your actual data growth projection, not an arbitrary large number. Storage costs scale with the ceiling you actually consume, not what you configure. - Verify engine support — all major RDS engines support autoscaling, but confirm your specific engine version and storage type in the AWS documentation.
Production Gotchas Engineers Hit With RDS Storage Autoscaling
Gotcha 1 — The Ceiling Is Not a Buffer
Teams sometimes set MaxAllocatedStorage only slightly above current usage — say, 110 GiB on a 100 GiB instance — expecting autoscaling to "kick in early." What actually happens: autoscaling triggers at the threshold, calculates a scale increment, and if that increment would exceed MaxAllocatedStorage, the expansion is capped at the ceiling. If the ceiling is already nearly reached, the expansion may be smaller than the calculated increment, leaving the instance still critically low. Set the ceiling with genuine headroom.
Gotcha 2 — Multi-AZ Scaling Takes Longer
On Multi-AZ deployments, storage expansion must complete on both the primary and standby instances. The operation is still online and non-disruptive to application traffic, but the time to complete is longer than on a Single-AZ instance. During this window, another autoscaling event cannot be initiated. If your storage is draining faster than the expansion completes, you are in a race condition that autoscaling alone cannot win — a manual pre-emptive increase is the correct response.
Gotcha 3 — Autoscaling Does Not Appear to Fire (Silent Misconfiguration)
The symptom: storage is clearly below threshold, 5 minutes have passed, but no expansion occurs. The first diagnosis engineers reach for is "autoscaling must be broken." The actual cause is almost always that MaxAllocatedStorage equals AllocatedStorage — autoscaling is effectively disabled because there is no ceiling above the current size. Check this first, before opening a support case.
aws rds describe-db-instances \
--db-instance-identifier my-production-db \
--query 'DBInstances[0].{Allocated:AllocatedStorage,MaxAllocated:MaxAllocatedStorage}'
If both values are identical, that is your answer. The fix is a single CLI call to raise MaxAllocatedStorage.
Equal values mean autoscaling is off, regardless of what the console checkbox shows.
IAM Permissions Required for RDS Storage Autoscaling
To modify MaxAllocatedStorage, the calling principal needs rds:ModifyDBInstance. To read the current configuration, rds:DescribeDBInstances is required. Follow least privilege — scope rds:ModifyDBInstance to specific instance ARNs where your IAM policy supports it.
🔽 Click to expand: Minimal IAM policy example
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds:ModifyDBInstance",
"rds:DescribeDBInstances"
],
"Resource": "arn:aws:rds:us-east-1:123456789012:db:my-production-db"
}
]
}
Note: rds:DescribeDBInstances may require "Resource": "*" depending on your policy context — verify against the AWS Service Authorization Reference for your specific use case.
Monitoring Storage Before and After Enabling RDS Storage Autoscaling
Enable a CloudWatch alarm on the FreeStorageSpace metric for your RDS instance. Set the alarm threshold above the autoscaling trigger point — for example, alert at 15% free space so you have visibility before autoscaling fires, not after. This gives your team time to investigate growth patterns rather than reacting to an already-triggered expansion.
After autoscaling fires, check the AllocatedStorage value via describe-db-instances — it will reflect the new expanded size once the operation completes.
Wrap-Up: RDS Storage Autoscaling Is a Safety Net, Not a Strategy
RDS Storage Autoscaling prevents the worst-case scenario — a full disk causing write failures — but it is not a substitute for capacity planning. Use it as a floor, not a ceiling strategy. Set MaxAllocatedStorage based on realistic growth projections, monitor FreeStorageSpace proactively, and treat an autoscaling event as a signal to review your data retention and archival policies.
For the authoritative reference, see the AWS documentation: Managing capacity automatically with Amazon RDS Storage Autoscaling.
Glossary
| Term | Definition |
|---|---|
| AllocatedStorage | The current provisioned storage size of the RDS instance, in GiB. |
| MaxAllocatedStorage | The upper ceiling for autoscaling. When greater than AllocatedStorage, autoscaling is active. When equal, autoscaling is effectively disabled. |
| FreeStorageSpace | CloudWatch metric reporting available storage on the RDS instance in bytes. |
| Multi-AZ | An RDS deployment mode that maintains a synchronous standby replica in a second Availability Zone for high availability. |
| Storage Autoscaling | An RDS feature that automatically increases allocated storage when free space drops below defined thresholds, without requiring manual intervention or downtime. |
Comments
Post a Comment