We had the same small service, an HTTP endpoint that validates a webhook, enriches it from a database and writes to a queue, running on all three clouds for different customers. On paper it was "a function" on each. In practice the three deployments needed different connection pool settings, had different cold start behaviour, and produced bills that differed by a factor of three at the same traffic.

This post compares AWS Lambda, Google Cloud Run functions and Azure Functions on the things that actually changed our design. Limits change often; every number here comes from the providers' documentation at the time of writing, and the references link to the pages to re-check.

The concurrency model is the biggest difference

AWS Lambda

Cloud Run functions

Azure Functions (Flex Consumption)

Requests per instance at once

1

Configurable, default 80, up to 1,000

Configurable per instance for HTTP (default depends on instance memory)

Scaling unit

Execution environment

Container instance

Instance

Default scale limit

Account concurrency quota per region (1,000 by default, can be raised)

Max instances per function (configurable)

Up to 1,000 instances per app

Lambda gives each execution environment one request at a time. Ten simultaneous requests mean ten environments. That makes the code simple (no shared state between concurrent requests) but it means ten database connections, ten cold starts during a burst, and billing for ten durations.

Cloud Run functions (the new name for Cloud Functions since 2024, now running on Cloud Run) can send many requests to the same instance. One instance with concurrency 80 can absorb a burst that would create 80 Lambda environments. Your code must be safe for concurrent requests, and your connection pool must be sized for it.

Azure Functions Flex Consumption, the current recommended serverless plan, also lets one instance process several HTTP requests concurrently, and you choose the instance memory size. The older Consumption plan scales differently and its Linux version is being retired, so new apps should start on Flex Consumption.

What it meant for our service: on Lambda we set a tiny pool (one connection per environment) and used RDS Proxy to protect the database. On Cloud Run functions and Azure we used a pool of ten per instance and kept the instance count low.

Limits side by side

AWS Lambda

Cloud Run functions

Azure Functions (Flex Consumption)

Max execution time

15 minutes

HTTP up to 60 minutes; event-driven up to 9 minutes

Default 30 minutes, configurable higher; HTTP responses limited to about 230 seconds by the front end

Memory

128 MB to 10,240 MB

Up to 32 GiB

Instance sizes of 512 MB, 2,048 MB or 4,096 MB

CPU

Proportional to memory, up to 6 vCPU

Configurable, up to 8 vCPU

Tied to instance size

Request payload (synchronous)

6 MB

32 MiB (HTTP/1)

Driven by host limits (100 MB default for HTTP)

Local disk

/tmp 512 MB to 10,240 MB

In-memory file system, counts against memory

Temporary local storage per instance

Packaging

Zip or container image

Source (built into a container)

Zip package

The Azure HTTP limit surprises people: even when the function timeout is long, an HTTP request that takes longer than about 230 seconds is cut by the load balancer in front of the app. Long work belongs in a queue-triggered function or Durable Functions.

Cold starts and the levers each platform gives you

A cold start happens when a new instance must be created before it can serve a request. All three platforms offer ways to reduce how often that happens and how long it takes.

Lever

AWS Lambda

Cloud Run functions

Azure Functions (Flex)

Keep instances warm

Provisioned concurrency (billed while configured)

Minimum instances (billed at idle rate)

Always-ready instances (billed baseline)

Faster startup

SnapStart for Java, Python and .NET

Startup CPU boost

Smaller deployment package, fewer dependencies

Fewer cold starts in bursts

No (one request per environment)

Concurrency per instance

Concurrency per instance

Generic advice that held on all three:

  • Initialise SDK clients and connection pools outside the handler, so warm invocations reuse them.

  • Trim dependencies. Our Node.js package went from 48 MB to 9 MB after removing an unused PDF library, and cold starts dropped by roughly a third on each platform.

  • Measure cold starts separately from warm latency. Averages hide them.

Our small benchmark: Node.js 22, 512 MB (Lambda), 512 MiB with concurrency 80 (Cloud Run functions), 512 MB instance (Flex), 10,000 requests in bursts of 200. These numbers are from one service in one region each and only show the shape, not a ranking.

Cold starts per 10,000 requests

Cold start p50

Warm p50

AWS Lambda

214

about 310 ms

18 ms

Cloud Run functions

11

about 900 ms

21 ms

Azure Functions Flex

9

about 750 ms

24 ms

Lambda's individual cold starts were fastest, but it had far more of them because every burst needed new environments. With concurrency per instance, the other two had few cold starts but each one took longer because a whole container started.

Triggers and integrations

Event source

AWS Lambda

Cloud Run functions

Azure Functions

HTTP

Function URLs, API Gateway, ALB

Built-in HTTPS endpoint

HTTP trigger

Queue

SQS (event source mapping)

Pub/Sub via Eventarc

Storage Queues, Service Bus

Object storage

S3 notifications

Cloud Storage via Eventarc

Blob trigger, Event Grid

Streams

Kinesis, DynamoDB Streams, Kafka

Pub/Sub, Eventarc sources

Event Hubs, Cosmos DB change feed

Schedule

EventBridge Scheduler

Cloud Scheduler

Timer trigger

Azure's bindings model is distinctive: input and output bindings let a function read from or write to services through configuration rather than SDK calls. It reduces code, but it also hides retries and batching behaviour you should understand.

Retries differ as well. Lambda retries asynchronous invocations twice by default and SQS-driven invocations until the message reaches its redrive policy. Eventarc and Pub/Sub retry with backoff according to subscription settings. Azure queue triggers retry up to five times before moving a message to a poison queue. Make every handler idempotent.

Pricing units

AWS Lambda

Cloud Run functions

Azure Functions (Flex)

Compute

GB-seconds of duration, per millisecond

vCPU-seconds and GiB-seconds while serving (request-based billing)

GB-seconds of on-demand execution

Requests

Per million requests

Per million requests

Per million executions

Warm capacity

Provisioned concurrency per GB-second

Minimum instances at a lower idle rate

Always-ready baseline per GB-second

Free tier

Monthly free requests and GB-seconds

Monthly free requests and compute

Monthly free executions and GB-seconds on demand

Because Lambda bills each concurrent request's full duration, a function that mostly waits on network calls costs more there than on a platform where one instance overlaps many waiting requests. For CPU-bound work with little waiting, the difference shrinks. Model your own traffic with each provider's calculator before deciding.

Choosing

  • Lambda fits event-driven glue inside AWS: S3, SQS, DynamoDB Streams, EventBridge. It has the deepest integration with its own cloud and the simplest per-request model.

  • Cloud Run functions fit I/O-heavy HTTP services and teams that may later want a full container; moving a function to a Cloud Run service is a small step.

  • Azure Functions fit Microsoft-centric stacks, especially with Service Bus, Event Hubs and Durable Functions for long workflows.

Common mistakes

Mistake

Why it hurts

Do this instead

Same connection pool size on every platform

Too many DB connections on Lambda, too few on others

Size pools to the concurrency model

Long synchronous HTTP work on Azure

Requests cut at about 230 seconds

Queue plus status endpoint, or Durable Functions

Global mutable state with per-instance concurrency

Data leaks between concurrent requests

Keep request data in local variables

Ignoring retries

Duplicate side effects

Idempotency keys on every handler

Comparing only per-request prices

Concurrency changes total duration billed

Model with real traffic shape

Key takeaways

  • Concurrency per instance is the difference that changes code, connection pools and cost.

  • Check timeouts and payload limits before you design; Azure HTTP has a hidden 230-second cap.

  • Each platform has warm-capacity options; all of them cost money while idle.

  • Retry semantics differ; idempotent handlers are mandatory everywhere.

  • Re-check limits on the official pages; they change several times a year.

References