Serverless
Intermediate 12 min read Serverless

Serverless Limits & Quotas

The fine print that scales up with you

Every serverless platform has hard limits hiding in plain sight: timeout, memory/size, payload, concurrency, and burst. Architecting inside limits means designing for them before they bite at 200 pct request surge.

timeoutpayload sizeconcurrencymemoryquotaburstlimits
Before we start

What you will learn

  • List the platform limits that govern function design
  • Design payload and timeout handling within ceilings
  • Reason about concurrency-region burst and how to raise them
In 60 seconds

Lambda defaults: 900s timeout, 10GB RAM (some 15min/10GB ceilings), 6MB sync/10MB async payload, 5000 total × 3000 regional burst (raises with limit request). Azure Functions similar per plan/host; Cloud Run: per-instance memory/times/requests. Design floors: small payloads, streaming, chunking, and async invocation.

Introduction

What is this?

Timeout: Lambda 900s default (15min max), HTTP contexts time out earlier; Azure plan-dependent/consumption 10min; Cloud Run per-instance 60m but HTTP may be less. Memory: min/max per runtime, aligns with CPU thresholds. Payload/response: sync 6MB, async/API-Gateway 10MB/6MB; S3 and reserved across calls. Concurrency: per-Region 1000 default (up to 5000+), reserved concurrency per function, burst 3000/1000/500/100. Cold budget and concurrency interplay: if an external dependency has 50 connections/500RPS, function concurrency must be bounded by a semaphore or wire limit to avoid DB/API meltdown.

Motivation

Why do you need it?

  • Timeout bugs beat big back-end rules: a 900s job that needs 901s silently fails.
  • Payload ceilings clip large requests; the web request layer obscures it until prod.
  • Default concurrency floors give bursts room; but each burst instance is billed duration.
  • Concurrency caps protect downstream systems and your wallet at once.
Think about it

Mental model

Imagine

A cargo elevator with a weight limit and a schedule

Think of

Serverless quotas

Your manifest (payload) must fit in the elevator (memory/size); the trip has a time limit (timeout); the building lets only so many trips run at once (concurrency).

Mechanics

How it works

  • Request/payload must fit invocation payload ceilings or the platform rejects it.
  • A function exceeding timeout is killed; async may retry per policy.
  • Each region has total + per-function concurrency budgets.
  • Burst floors define instantaneous scale from cold to warm.
  • Beyond caps the platform throttles with 429; clients retry or fail.

Limit pyramid.

Client payload
Memory
Timeout
Concurrency
429
Hands-on

Examples

Design inside the envelope

Design inside the envelope
# HTTP path: keep bodies < 6MB
# large uploads → presigned S3 URL, then handle object event
# long workers → async step function / queue, not a 15-min lambda
# downstream → per-function reserved concurrency = DB connection budget

The envelope is a spec you code against, turning limits into explicit choices rather than accidents.

Real world

In production

  • Payment webhooks (< 60KB) via API Gateway sync function.
  • Bulk CSV import: client uploads to S3 → event → chunked processing.
  • External-tick system: reserve ≤ 100 concurrency per function to match API caps.
  • Video transcode: queued jobs across batch workers, not giant functions.
Guidelines

Best practices

  • Document the limits you target (timeout, payload, concurrency) in the service chapter.
  • Split big work into chunked or queued jobs before hitting payload/timeout walls.
  • Bound cross-system coupling with reserved concurrency near your partner's ceilings.
  • Set cost/limit alarms: invocation rate, throttles, and concurrency near squash.
Watch out

Common mistakes

  • Trusting the default when the traffic shape is bursting (burst tokens are not free).
  • Ignoring sync payload size until the 5.9MB CSV breaks the API in prod.
  • Running a 14-minute cron on a 900s function and wondering why it truncates.
  • Sat PDFs/db download inside /tmp of a timeout-bound function instead of streaming.
When things break

Debugging tips

  • 429s in metric → throttle; look at concurrency + burst before blaming code.
  • Timeout tails on pattern: job T≈898s means you're one field away from the 900s wall.
  • API-Gateway 502/504 with 'endpoint request timed out' → gateway integration timeout first.
  • Monitor 2xx/4xx/5xx by stanza: throttles show as 429 distinct from code errors.
Interviews

Interview checkpoint

Test yourself

Quick quiz

0/2
1

When a function exceeds concurrency quotas you see:

2

The largest single lever to avoid timeout walls is:

Go deeper

Official documentation