SQS Lambda ESM Scaling Behaviour - Experiment Batch Size vs Queue Depth
#Test
This page only contains the experiments that have been done for the: SQS Lambda ESM Scaling Behaviour blog post.
In these experiments we paused the ESM Lambda poller and enqueued different numbers of messages (1,000; 10,000; 100,000; 1,000,000) before resuming the poller and measuring the invocation and cold start rate over time. Processing time is kept at 200ms while varying batch size.
#Batch Size 1
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 36 | 1.2 | 72 | 30s |
| 10,000 | 136 | 2.7 | 162 | 50s |
| 100,000 | 468 | 3.6 | 216 | 2m 10s |
| 1,000,000 | 700 | 2.3 | 138 | 5m 10s |
📈 CLICK TO SEE QUEUE DEPTH 1000, 10,000, 100,000 and 1,000,000 DETAILED RESULTS
#Queue Depth 1,000
#Queue Depth 10,000
#Queue Depth 100,000
#Queue Depth 1,000,000
#Batch Size 2
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 34 | 1.7 | 102 | 20s |
| 10,000 | 83 | 2.1 | 126 | 40s |
| 100,000 | 324 | 3.6 | 216 | 1m 30s |
| 1,000,000 | 698 | 2.8 | 168 | 4m 10s |
📈 CLICK TO SEE QUEUE DEPTH 1000, 10,000, 100,000 and 1,000,000 DETAILED RESULTS
#Queue Depth 1,000
#Queue Depth 10,000
#Queue Depth 100,000
#Queue Depth 1,000,000
#Batch Size 5
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 25 | 1.3 | 78 | 20s |
| 10,000 | 70 | 2.3 | 138 | 30s |
| 100,000 | 200 | 2.9 | 174 | 1m 10s |
| 1,000,000 | 654 | 3.8 | 228 | 2m 50s |
📈 CLICK TO SEE QUEUE DEPTH 1000, 10,000, 100,000 and 1,000,000 DETAILED RESULTS
#Queue Depth 1,000
#Queue Depth 10,000
#Queue Depth 100,000
#Queue Depth 1,000,000
#Batch Size 10
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 15 | 0.8 | 48 | 20s |
| 10,000 | 46 | 1.5 | 90 | 30s |
| 100,000 | 129 | 2.6 | 156 | 50s |
| 1,000,000 | 480 | 3.7 | 222 | 2m 10s |
📈 CLICK TO SEE QUEUE DEPTH 1000, 10,000, 100,000 and 1,000,000 DETAILED RESULTS
#Queue Depth 1,000
#Queue Depth 10,000
#Queue Depth 100,000
#Queue Depth 1,000,000
#Batch Size 10 & Batch Window 1 second
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 13 | 0.7 | 42 | 20s |
| 10,000 | 47 | 1.6 | 96 | 30s |
| 100,000 | 122 | 2 | 120 | 1m |
| 1,000,000 | 480 | 3.4 | 204 | 2m 20s |
Adding a 1-second batch window at batch size 10 introduces a small but measurable drag on cold start velocity. The 1M run shows ~3.4cold starts per second compared to ~4cold starts per second without the batch window — the extra buffering time slightly reduces the pressure the ESM poller observes, but the effect is modest at this batch size.
📈 CLICK TO SEE QUEUE DEPTH 1000, 10,000, 100,000 and 1,000,000 DETAILED RESULTS
#Queue Depth 1,000
#Queue Depth 10,000
#Queue Depth 100,000
#Queue Depth 1,000,000
#Batch Size 100 & Batch Window 1 second
| Queue depth | Total cold starts | Avgcold starts per second | Avg cold starts per minute | Processing time |
|---|---|---|---|---|
| 1,000 | 5 | 0.5 | 30 | 10s |
| 10,000 | 8 | 0.4 | 24 | 20s |
| 100,000 | 23 | 1.2 | 72 | 20s |
| 1,000,000 | 75 | 0.9 | 54 | 1m 20s |
At batch size 100 the pattern changes. The small-queue experiments drained before any meaningful scaling rhythm could develop. Even the 1M run shows a much lower velocity (~1.5cold starts per second vs ~4cold starts per second for smaller batch sizes). With 100 messages per invocation, far fewer concurrent Lambda invocations are needed to drain the queue, which reduces the provisioning pressure the ESM poller observes.