Serverless Architecture: Throttle and Concurrency Limits

A flash sale starts at noon. Traffic to your checkout API jumps tenfold in ninety seconds. API Gateway starts returning 429s, the Lambda concurrency ceiling is hit, requests pile up in the integration, and the DynamoDB table behind the function starts throttling writes. Nobody raised a limit that morning — and nobody had to. The system failed because three separate ceilings were hit in sequence, and each one hid the next.

This is the part of serverless that tutorials skip. Writing a function is easy. Understanding what happens between the API Gateway throttle, the Lambda concurrency ceiling and the downstream limits is what separates a system that degrades from one that cascades.

Three ceilings, three different failure modes

It helps to think of a serverless request path as a corridor with three doors of different widths. API Gateway is the front door. Lambda concurrency is the middle door. DynamoDB or SQS is the back door. Each has its own quota logic, and each fails differently.

API Gateway throttling works on a token-bucket model with two numbers: a steady-state rate (requests per second) and a burst allowance. The burst is not extra capacity you can use all day — it is a bucket that refills at the steady rate. Spend it in one spike and you wait for the refill.

Lambda concurrency limits are counted in simultaneous executions, not requests per second. A function that takes 800 ms to run and receives 1,000 requests per second needs roughly 800 concurrent executions to keep up. A function that takes 80 ms needs 80. Same traffic, ten times less concurrency — and this is why latency is a concurrency multiplier, not just a user-experience issue.

Downstream limits are the quiet ones. DynamoDB partitions have their own throughput ceilings, and SQS has message and in-flight limits. A Lambda function that scales instantly can easily outrun a table that scales gradually.

Throttling is a symptom, not the disease A 429 from API Gateway usually means one of the later doors is narrower than the front one. Raising the front limit without checking the back is how a graceful 429 turns into a 500 cascade.

Reserved and provisioned concurrency change the failure mode, not just the number

Here is the counterintuitive part. Setting reserved concurrency on a Lambda function does not raise your ceiling. It caps that function's share of the account-wide pool and guarantees it cannot be starved by a noisy neighbour. The failure mode changes: instead of competing with everything else in your account, the function hits its own wall predictably — and the rest of your system keeps running.

Provisioned concurrency is different. It pre-warms a set of execution environments so they respond without a cold start. You pay for them whether they run or not. It helps latency-sensitive paths and does nothing for throughput once the provisioned set is exhausted — requests beyond it fall back to on-demand scaling or get throttled, depending on how you configured things.

A common mistake: teams enable provisioned concurrency on a checkout function, see p99 latency drop, and conclude the scaling problem is solved. Then a spike arrives, the provisioned set saturates, and the fallback path behaves exactly as it did before — only now nobody is watching it because the dashboards looked healthy for weeks.

What a throttled request actually costs you

A 429 is not free. It costs a retry, and retries are where serverless bills and outages both hide.

If your client retries with exponential backoff and jitter, a throttled request costs a little latency and some extra invocations. If your client retries immediately — or worse, your SDK does it for you with default settings — a throttled request multiplies into several. Under sustained throttling this is a retry storm: the system spends its capacity rejecting and re-accepting the same work instead of doing new work.

There is also a subtler cost. A throttled request that the user sees as a failure may still have partially executed downstream. A write that reached DynamoDB before the function timed out is not rolled back because the client got a 429. Idempotency keys stop this from becoming duplicate orders — and if you have ever debugged a double charge after a traffic spike, you know the difference between a limit and a correctness bug.

Where a queue beats raising the limit

This is the design decision that matters more than any quota number. Ask a simple question: does this request need a synchronous answer, or does it just need to happen?

A login needs a synchronous answer. A password-reset email does not. A payment authorisation needs one. A receipt PDF does not. For everything in the second column, putting an SQS queue in front of the Lambda function is usually better than raising the concurrency limit.

Why? Because a queue absorbs the spike instead of propagating it. The queue depth grows, the consumer scales at whatever rate the downstream can sustain, and nothing returns a 429 to the user. You trade a few seconds of latency for the guarantee that the work eventually happens.

The trade-off is real: you now own dead-letter queues, idempotency, and a new failure mode (messages that never get processed because nobody is watching the DLQ). A queue is not free complexity. But it is usually cheaper than a cascading failure at 3 a.m.

Raise the limit vs put a queue in front
Raise the concurrency limit
  • Spike hits the function directly
  • Downstream sees full load at once
  • Users get 429s or timeouts
  • Retry wave amplifies the spike
  • Simple to configure
Put a queue in front
  • Queue absorbs the spike
  • Consumer scales at downstream pace
  • Users wait, nothing fails
  • Retries handled by the queue
  • You own the DLQ and idempotency

A sizing checklist for graceful degradation

Before you pick a single number, walk through this in order. The order matters — each step constrains the next.

  1. Measure the p95 duration of the function, not the average. Concurrency is driven by how long the slow tail holds a slot.
  2. Estimate peak requests per second from your actual traffic pattern, including the spike you expect at launch or sale events.
  3. Multiply: concurrency needed ≈ RPS × p95 duration in seconds. That is your target ceiling.
  4. Check the downstream: can DynamoDB or the database behind the function absorb that concurrency at its own throughput ceiling? If not, the Lambda limit is not your real limit.
  5. Set reserved concurrency on critical functions so they cannot be starved, and on non-critical functions so they cannot starve others.
  6. Set API Gateway throttling below the Lambda ceiling, so the front door rejects before the middle door saturates. A 429 at the edge is cheaper than a timeout deep in the stack.
  7. Put a queue in front of anything asynchronous rather than raising limits.
  8. Write down the numbers and the reason next to each one in your infrastructure code. Six months from now, nobody will remember why the limit is 200.
Leave headroom for the retry wave A spike that trips throttling generates retries. If your limits are set exactly at expected peak, the retry wave has nowhere to go. Leave at least a third of headroom between your expected peak and the ceiling you configure.

The metrics that tell you which knob to turn

If you only watch error rate, you will see the symptom and not the cause. These metrics tell you which door is too narrow:

Symptom Metric to check Likely knob
429s from API Gateway 4XXError at the API stage, Count on the throttle API Gateway throttle settings
Lambda Throttles rising while API Gateway is fine ConcurrentExecutions vs reserved limit Reserved concurrency or downstream capacity
Timeouts, not throttles Function duration p95, downstream latency Function code or downstream throughput
Queue depth climbing steadily SQS ApproximateAgeOfOldestMessage Consumer concurrency, not producer limit
Retry storms Invocation count vs request count Client retry policy

Notice that the first two rows look similar from the outside — both are "requests failing" — but they point at opposite ends of the corridor. That is why dashboards that only show error rate and latency are not enough. You need the concurrency count, the throttle count and the queue age side by side.

There is a deeper point here about event-driven architecture backpressure. In a synchronous chain, backpressure propagates naturally: a slow downstream makes the caller wait. In an event-driven system, backpressure has to be designed. A queue is one form of it. Reserved concurrency is another. Without either, events pile up invisibly until something falls over. More on the topic: “Cloud Architecture (AWS/GCP/Azure): How to Choose a Cloud Without Locking Yourself In”.

Why this is harder to learn alone than it looks

The mechanism is not complicated once you see it. The difficulty is that every decision depends on the others, and the feedback arrives late. You set a concurrency limit, deploy, and nothing breaks — until a real spike six weeks later tells you whether you were right. By then the person who chose the number has moved to another team.

That late feedback is why self-study on serverless tends to stall at the "I can deploy a function" stage. Reading the docs tells you what each limit is. It does not tell you how they interact under load, or which of your assumptions is the fragile one. You need someone to check your reasoning against a scenario before production does it for you.

A structured path helps precisely because it forces you through the sizing exercise with feedback. The Serverless Architecture course covers API Gateway, Lambda, DynamoDB and event-driven design, and its lessons adapt to your results — deeper material where you score well, reinforcement where you do not. It is not the only route: the official AWS documentation is excellent and free, and building a small project with a deliberate load test will teach you a lot. But a project alone will not tell you when your reasoning is wrong. More on the topic: “Microservices Architecture in Practice: Docker, Kubernetes, Queues, and Observability — A Real-World Scenario Breakdown”.

For the design side of the same problem, the broader picture of where functions break and how to design around it is worth reading alongside this piece. More on the topic: Serverless Architecture: Where Lambda and Cloud Functions Break, and How to Design Around It. And if your serverless functions sit behind an API layer that unites several services, the gateway patterns overlap heavily. More on the topic: GraphQL Federation and API Gateway: How to Unite 30 Microservices into One API Without Pain.

Who this suits and who it does not

This material suits engineers who already run something in the cloud and have felt a limit bite — a 429 they did not expect, a queue that grew overnight, a bill that jumped after a spike. It suits platform and SRE teams who own the numbers rather than the code.

It does not suit absolute beginners with no cloud exposure. If you have never deployed a function or read a CloudWatch graph, the sizing discussion will be abstract until you have something running. Start with a small project first, then come back.

And it does not suit teams looking for a single number to copy. There is no universal correct concurrency value. There is only a value that fits your p95 duration, your downstream capacity and your spike profile — and a checklist to find it.

The next time a spike hits, you will know which door is too narrow before the pager goes off. That is the whole point of sizing this deliberately.

AssetMaterials for this article

A document from this article — download and apply it.

  • XLSXServerless Concurrency & Throttle Sizing Calculator.xlsxXLSX · 8.4 KBDownload
← All posts

Ask AI about this article

Ask a question about this article — ASI Biont will answer based on its text and the attached files.