
How Fast Does Amazon DocumentDB Serverless Scale?
Part 2 of 5 diving deep in Amazon DocumentDB Serverless through empirical testings
Series: Amazon DocumentDB Serverless: An Empirical Study (5 articles)
- 2How Fast Does Amazon DocumentDB Serverless Scale? This article
When Amazon DocumentDB Serverless scales, how long does the transition take? Do queries fail during the change? Does starting from a higher MinCapacity make scale-out faster? Does the cluster hold elevated capacity for a while after your workload ends, or drop back to floor immediately? This article measures the timing of both directions - scale-out to meet demand, and scale-in to release capacity - across MinCapacity floors from 0.5 to 8 DCU, twelve independent iterations, and three sustained-workload settling points. The findings are consistent enough to design around, and some of them contradict the intuition of "higher floor = faster response".
Who this is for
You are designing an application that will use Amazon DocumentDB Serverless and you need to answer questions like: should we pre-warm the cluster before an expected traffic spike, or trust autoscaling? How long after a batch job ends will we keep paying for elevated capacity? Will queries fail during scaling, or just slow down? This article measures those numbers directly.
Executive summary
Five findings from timed experiments on DocumentDB 8.0.1 Serverless:
- Scale-out reaches 90% of achievable throughput in ~5 seconds under sustained workload demand. Measured range: 5.06 to 5.34 seconds across twelve iterations. Coefficient of variation: 1.5%.
- Starting MinCapacity does not accelerate scale-out. A cluster starting at MinCap 8 reached full throughput in the same ~5 seconds as one starting at MinCap 0.5. What differed was the starting throughput itself, not the ramp time.
- Zero query errors during any scale-out event. Twelve iterations, 300+ seconds of scale-out time in aggregate. Requests slowed transiently in some 1-second windows but always completed.
- Scale-in takes 10 minutes with connections closed, 15-17 minutes with idle connections held. The floor may never be reached if enough sockets are open (see Part 1).
- Under sustained partial workload, DCU settles at approximately throughput/200. 300 ops/sec settled at ~7 DCU; 1,000 ops/sec settled at ~14 DCU. The cluster right-sizes rather than binary-swinging between floor and peak.
How we measured this
Same lab as Part 1: single-instance DocumentDB 8.0.1 Serverless in
us-east-1 , PyMongo 4.9.2 workload from an EC2 client in the same VPC, both server-side (CloudWatch 30s cadence) and client-side (1 Hz latency probe) instrumentation. The full methodology and reproducer scripts are in Part 0 of this series .The critical instrumentation choice for scale-out timing: CloudWatch aggregates over 60-second windows and publishes at that cadence, which is insufficient to measure a 5-second scale-out event. All timing numbers in this article come from the client-side probe recording per-second throughput at 1 Hz. CloudWatch confirms the same scaled-out state 60-90 seconds later, once its aggregation window catches up.
Experiment 1: Scale-out timing across MinCapacity floors
Setup. Same workload (100 concurrent PyMongo clients × target 30 ops/sec/client = 3,000 ops/sec target) launched against clusters at five different MinCapacity floors: 0.5, 1, 2, 4, 8 DCU. Client-side per-second throughput recording starts one second before workload launch. Measure time from workload start to when observed throughput crosses 90% of the eventual steady-state value.
Result.
MinCap | Iteration 1 | Iteration 2 (300 conns × 30 ops) | Time-to-90% |
|---|---|---|---|
0.5 | 5.09s | - | 5.09s |
1.0 | 5.13s | 5.06s | 5.06-5.13s |
2.0 | 5.11s | 5.07s | 5.07-5.11s |
4.0 | 5.08s | 5.09s | 5.08-5.09s |
8.0 | 5.06s | 5.34s | 5.06-5.34s |
Twelve iterations across five MinCapacity floors and two workload sizes produced time-to-90% values within a 280 ms window (5.06s to 5.34s). Coefficient of variation: 1.5%.
Interpretation. Scale-out speed is essentially independent of starting MinCapacity. What changes with MinCap is the starting throughput (a cluster at MinCap 8 already has 16× the capacity of one at MinCap 0.5, so its baseline throughput is already high) but the transient response time to load is not accelerated. The autoscaler decision-and-provision loop takes the same ~5 seconds regardless of floor.
This runs counter to the intuition of "pay for more MinCapacity to get faster response". If your goal is fast response to burst traffic, MinCap is the wrong lever - you already have that speed at MinCap 0.5. MinCap is a floor for two other things: peak connection ceiling (Part 4) and working-set cache size (Part 3).
Experiment 2: Scale-out timing at heavier workload
Setup. Same test as Experiment 1, but at 300 concurrent PyMongo clients × 30 ops/sec = 9,000 ops/sec target. Run at MinCapacity 2, 4, 8 DCU.
Result. All three iterations reached 90% steady-state in 5.06-5.34 seconds - the same range as the lighter workload. Scale-out timing is workload-invariant across the range tested.
At the higher workload, the cluster reached a higher peak DCU (~15 DCU vs. ~10 DCU on the 3,000 ops/sec workload) but the time to reach that higher peak was unchanged.
Interpretation. The autoscaler's response cadence is fixed. Whether it needs to add 2 DCU or 15 DCU, the decision loop appears to run on the same ~5-second interval. This suggests DocumentDB Serverless uses discrete capacity-adjustment events rather than a proportional controller.
Experiment 3: Query errors during scale-out
Across all twelve scale-out iterations from Experiments 1 and 2, the client instrumentation recorded:
- Zero connection failures. All 100 (or 300) clients connected and stayed connected through the transition.
- Zero query errors. No
ExecutionTimeout, noAutoReconnect, no timeout exceptions.
- Transient throughput dips. Some 1-second windows during the scale-out transition showed per-client throughput below the target rate. These dips resolved within 1-2 seconds and did not manifest as request-level failures.
Practical implication. You do not need to build retry logic specifically for scale-out events. Your normal per-operation retry policy (which you already have for network transient errors) is sufficient. This differs from provisioned instance failover, where connection resets are expected and require explicit driver-level handling.
Experiment 4: Scale-in timing baseline
Setup. Warm the cluster with 100 clients × 30 ops/sec for 3 minutes (DCU stabilizes near 14). Stop the workload and close all connections. Observe DCU trajectory until it returns to MinCapacity floor (0.5 DCU).
Result.
Minute after workload end | DCU average |
|---|---|
t+0 | 13.12 |
t+2 | 12.50 |
t+4 | 12.00 |
t+5 | 11.50 |
t+6 | 5.99 (first significant drop) |
t+7 | 5.00 |
t+9 | 3.55 |
t+10 | 0.57 (floor reached) |
Two distinct phases:
- Cooldown (t+0 to t+5). DCU holds essentially flat at the warmup peak for approximately 5 minutes. This appears to be a deliberate cooldown window before the autoscaler considers scaling in.
- Step-down (t+5 to t+10). After cooldown, DCU drops in stepped increments (~14 → 5 → 3 → 0.5) over 5 minutes. The steps are not smooth glides; they look like discrete decisions on a fixed cadence.
Total: 10 minutes from workload end to MinCap floor, with connections closed.
Experiment 5: Scale-in with idle connections held
Part 1 covered this experiment in the context of "do idle connections prevent scale-in?" This article looks at the same data through the timing lens.
Result.
Idle clients held | Cooldown ends | Time to floor |
|---|---|---|
0 | ~5 min | 10 min |
10 | ~5 min | 15 min |
100 | ~5 min | 16 min |
500 | ~5 min | Never (holds at ~2 DCU indefinitely) |
The cooldown phase is unaffected by connection state - all four configurations held DCU flat for the first ~5 minutes after workload end. What differed was the step-down phase: with connections closed, DCU dropped from ~14 to floor in 5 minutes. With 100 idle connections held, the same drop took 11 minutes.
Practical implication. If you want to release serverless capacity quickly after a batch job, close the connections when the job ends. This is not just cleanliness - it changes your billing envelope. Ten minutes at ~5 DCU vs. 16 minutes at ~10 DCU is a real cost delta on a batch workload that runs frequently.
Experiment 6: Right-sizing under sustained partial workload
Setup. After the 3-minute warmup (workload at 3,000 ops/sec), instead of stopping workload entirely, drop to a sustained lower level and observe DCU trajectory over 20 minutes.
Result.
Sustained workload | Final DCU state |
|---|---|
0 ops/sec (baseline) | 0.5 DCU (floor) after 10 min |
300 ops/sec | ~7 DCU, stable indefinitely |
1,000 ops/sec | ~14 DCU, stable indefinitely |
At 300 ops/sec, DCU dropped from the warmup peak of ~14 to ~7 over 5-6 minutes and then held. At 1,000 ops/sec, DCU held near the warmup peak (~14) with no meaningful scale-in.
Rough rule: DCU settles at approximately
throughput / 200 . 300 → 7 (300/43 = 7). 1,000 → 14 (1000/71 = 14). The exact coefficient depends on operation mix, but the shape is linear.Interpretation. DocumentDB Serverless is not a binary idle/busy system. It right-sizes to whatever sustained throughput is currently running. This has two practical consequences:
- If your application has a stable baseline throughput between bursts, DCU will not return to MinCapacity during the baseline window - it will settle at the DCU appropriate for that baseline. Plan billing accordingly.
- If you want DCU to reach floor between bursts, the baseline throughput must genuinely drop to zero (not to a low but non-zero level).
Synthesis: the scaling timeline

Figure: The full lifecycle of a serverless capacity event. Scale-out reaches 90% of achievable throughput in ~5 seconds. After workload ends, the cluster observes a ~5-minute cooldown before stepping down. Total time to reach MinCap floor: 10 minutes with connections closed, 15-17 minutes with idle connections held (below 500), never with 500+ idle connections held.
What this means for your application
Three practical rules from this article. (Parts 4 and 5 add more.)
Rule 1: Trust the 5-second scale-out. Don't pre-warm to accelerate it. If your traffic bursts naturally (user-driven, event-driven, cron-driven), the cluster will keep up within ~5 seconds of load arrival, with zero query errors. Pre-warming (raising MinCap ahead of expected traffic) is only worth doing to hold the working set in cache or to accommodate a known connection burst - not to accelerate throughput ramp.
Rule 2: Budget for 10-20 minutes of elevated capacity after each workload burst. For frequent short bursts, the tail-billing can dominate. If you run a 5-minute job every 30 minutes, you're paying for ~15 minutes of elevated DCU each cycle, which is more than the 5 minutes of "actual work". Consider batching multiple jobs into one longer run, or accept the tail cost as the trade-off for eliminating provisioned overhead.
Rule 3: Close connections when a batch job ends. Not just for hygiene - it shortens the tail-billing window by 6-7 minutes at 100 idle conns, and by "forever" at 500+ idle conns. If you use a connection pool that never releases sockets (some ORMs default to this), audit whether it's costing you steady-state DCU.
What we didn't measure
- Behavior at very large scale-out targets. Our workloads peaked at ~15 DCU. Whether scale-out timing to 50 DCU or 100 DCU holds at the same 5 seconds is unmeasured; we suspect the autoscaler's decision cadence is fixed, but the compute provisioning underneath may take longer at higher targets.
- Multi-instance serverless scaling. All measurements are single-instance. Multi-instance clusters with writer + serverless replicas may have coordination overhead that changes scale-out timing.
- The exact cooldown algorithm. We observed a ~5-minute cooldown before scale-in begins, but we did not test whether it resets on workload spikes during the window, or how the threshold is computed.
Coming next
Part 3 - What Happens to Your Application When DocumentDB Serverless Scales. Cold-cache latency after scale-in, in-flight query behavior during scale-out, and buffer cache re-warming dynamics.
Part 4 - Sizing MinCapacity: Three Rules. Connection ceiling, working-set cache size, and steady-state throughput as inputs.
Part 5 - When to Choose Provisioned Over Amazon DocumentDB Serverless. Where each option wins.
Reproducibility. All 15 experiments, raw JSON results, and Python driver scripts are in the companion GitHub repository .
Series: Amazon DocumentDB Serverless: An Empirical Study (5 articles)
- 2How Fast Does Amazon DocumentDB Serverless Scale? This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article