AWS Builder Center
What happens when 10,000 requests hit Lambda at once?

What happens when 10,000 requests hit Lambda at once?

This article breaks down concurrency, scaling, cold starts, throttling, and how SQS can help handle sudden traffic spikes.

Software Engineer
When I first learned AWS Lambda, I had a very simple mental model:
10,000 requests arrive → Lambda creates 10,000 instances → problem solved.
It sounds reasonable.
After all, isn't one of Lambda's biggest advantages automatic scaling?
But that's not quite what happens.
Understanding what actually happens when a Lambda function suddenly receives a huge burst of traffic introduces one of the most important concepts in serverless architecture:
Concurrency.



First: Lambda doesn't run all requests inside one process

Imagine this Lambda function:
API Gateway
↓
Lambda

One request arrives.
Lambda needs an execution environment to run your function:
Request 1
↓
Lambda Environment 1

Now a second request arrives while the first one is still running:
Request 1 → Environment 1
Request 2 → Environment 2

And another:
Request 1 → Environment 1
Request 2 → Environment 2
Request 3 → Environment 3

This is the basic idea behind Lambda concurrency.
Concurrency = the number of requests your Lambda function is processing at the same time.
AWS defines concurrency as the number of requests that are in flight at a given time.



Now let's throw 10,000 requests at it

Suppose we have:
API Gateway
↓
Lambda

And suddenly:
10,000 requests
↓
Lambda

What happens?
Lambda begins creating execution environments and distributing requests across them.
Conceptually:
Lambda
│
┌─────────┼─────────┐
↓ ↓ ↓
Environment Environment Environment
1 2 3
... ... ...
thousands

But here's the important part:
Lambda does not necessarily create 10,000 environments instantly.
Lambda has scaling limits and concurrency quotas that act as guardrails.



Concurrency is not the same thing as requests per second

This was one of the concepts that took me a while to understand.
Imagine your Lambda function takes 1 second to process a request.
If you receive:
1,000 requests/second

you could have roughly:
1,000 concurrent requests

But if your function takes only 100 milliseconds:
1,000 requests/second
×
0.1 seconds
=
100 concurrent requests

So a useful approximation is:
Concurrency ≈ Requests per second × Average duration

AWS uses this same relationship when explaining Lambda concurrency.
This means that 10,000 requests doesn't automatically mean 10,000 concurrent Lambda executions.
It depends on how quickly your function processes them.



So what if all 10,000 really arrive at once?

Now let's make the situation extreme.
Suppose:
  • 10,000 requests arrive almost simultaneously
  • Each request takes 1 second
  • They all need to be processed immediately
You could need around:
10,000 concurrent executions

But your AWS account has concurrency limits.
AWS currently documents a default regional account concurrency quota of 1,000 concurrent executions, although this quota can be increased.
So if your account only has 1,000 available concurrent executions:
10,000 requests
↓
Lambda
↓
┌─────────────────┐
│ 1,000 execute │
│ concurrently │
└─────────────────┘
↓
Remaining requests
↓
Potential throttling

This is where the word throttling becomes important.
If requests arrive faster than Lambda can scale, or your function reaches its concurrency limit, additional requests can receive a 429 throttling response for synchronous invocations.



But Lambda also has a scaling rate

There is another detail that surprised me.
Even if you have a large concurrency quota, Lambda doesn't necessarily scale from 0 to thousands of execution environments instantaneously.
For each function in a Region, Lambda documents a concurrency scaling rate of up to 1,000 additional execution environments every 10 seconds.
So there are two different ideas:
Concurrency limit
↓
"How many executions can I have?"

Scaling rate
↓
"How quickly can Lambda create
additional execution environments?"

Those are not the same thing.
This distinction becomes particularly important when you're dealing with sudden traffic bursts.



What about cold starts?

Now we get to another famous Lambda concept:
Cold starts.
When Lambda needs a new execution environment, AWS has to initialize that environment before your function can run.
Conceptually:
New request
↓
New environment
↓
Initialize runtime
↓
Load your code
↓
Run function

That initialization can add latency to the request.
If an execution environment is already available and warm:
New request
↓
Existing environment
↓
Run function

you can avoid that initialization work.
This is why cold starts become an important consideration when you're suddenly scaling Lambda.



Then why does Lambda scale so well?

Because Lambda doesn't require you to manually create servers.
That's the beauty of it.
With EC2, a sudden traffic increase might make you think about:
Do I have enough instances?
Should Auto Scaling launch more?
Do I need to increase capacity?
Is my load balancer ready?

With Lambda, AWS handles the underlying execution environments and scales your function according to demand, subject to Lambda's quotas and scaling behavior.
You focus on:
My function
↓
AWS manages the infrastructure

That's a massive reduction in operational complexity.



But here's where architecture becomes important

Imagine your Lambda does this:
Lambda
↓
DynamoDB

10,000 requests arrive.
Lambda scales up.
But now thousands of Lambda executions are simultaneously hitting your database.
Your bottleneck might no longer be Lambda.
It might be:
10,000 requests
↓
Lambda
↓
┌─────┴─────┐
↓ ↓
Database External API

This is why "Lambda automatically scales" doesn't mean "my entire application automatically scales."
Lambda might be perfectly capable of handling the traffic while your downstream dependency isn't.



This is where SQS becomes incredibly useful

Instead of:
API
↓
Lambda
↓
Database

you can introduce a queue:
API
↓
SQS
↓
Lambda
↓
Database

Now SQS can act as a buffer.
Imagine 10,000 pieces of work arrive:
10,000 messages
↓
SQS
↓
Lambda processes gradually
↓
Database

You can control how aggressively Lambda consumes messages, including configuring maximum concurrency for an SQS event source.
This gives your downstream systems some protection from sudden bursts.



So what actually happens?

Let's put everything together.
A simplified version looks like this:
10,000 Requests
│
▼
API Gateway
│
▼
Lambda
│
┌──────────┼──────────┐
▼ ▼ ▼
Env 1 Env 2 Env 3
│ │ │
└──────────┼──────────┘
│
More environments
as demand increases
│
▼
Concurrency limits
│
┌───────────┴───────────┐
▼ ▼
Requests served Throttling

And if we introduce SQS:
10,000 Requests
↓
API Gateway
↓
SQS
↓
Lambda consumers
↓
Database

Now the queue can absorb the burst while Lambda processes the work according to the available concurrency.



The mental model I now use

I stopped thinking about Lambda as:
"AWS gives me a server whenever I need one."
Instead, I think about it as:
"AWS gives my function execution environments as demand increases, while enforcing limits to protect the system."
And when I think about scaling, I ask three questions:

1. How much concurrency do I need?

Concurrency ≈ Request rate × Duration


2. How quickly is traffic arriving?

A sudden burst behaves differently from traffic that gradually increases.

3. Can my downstream systems handle the same scale?

Because scaling Lambda doesn't automatically scale:
Databases
External APIs
Third-party services
Other AWS services

That last question is probably the most important one.



One question for you

If 10,000 requests suddenly hit your Lambda, what do you think would become the bottleneck first?
Lambda?
The database?
An external API?
Or something else?
I'd love to hear how other AWS learners think about this.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article