Serverless computing lets you deploy code without managing the servers that run it. The provider handles provisioning, patching, and scaling, and you pay for execution rather than for idle capacity. AWS, Microsoft Azure, and Google Cloud all offer this model, but their function platforms differ in timeouts, memory, concurrency, and hosting plans. Those differences often matter more than the headline price.
What serverless means in practice
“Serverless” does not mean there are no servers. It means you do not manage them. You upload code or a container, configure a trigger such as an HTTP request, a queue message, or a file upload, and the platform starts instances as needed. When traffic stops, the platform can scale to zero, so you are not billed for idle time on most plans.
That model has tradeoffs. Each invocation has time and memory limits. Starting a new instance takes time, which can slow the first request. And the code must be written to be stateless, because the platform can run many copies of it at once.
Function services compared
| AWS Lambda | Azure Functions | Google Cloud Run functions | |
|---|---|---|---|
| First launched | November 2014 | Generally available November 2016 | Generally available 2018 as Cloud Functions; renamed August 2024 |
| Maximum timeout | 15 minutes | 10 minutes on the Consumption plan; longer on Premium | 60 minutes for HTTP functions; 9 minutes for event-driven functions |
| Concurrency model | One request per execution environment at a time; default of 1,000 concurrent executions per region (a soft limit) | Depends on the hosting plan | Up to 1,000 concurrent requests per instance (default 80) |
| Free allowance (per month) | 1 million requests and 400,000 GB-seconds | 1 million executions and 400,000 GB-seconds on Consumption | 2 million invocations |
Limits change over time, and free allowances are subject to each provider’s current terms. Check the official documentation before designing around a specific number.
AWS Lambda
Lambda was the first major function-as-a-service platform from a hyperscaler. You can allocate between 128 MB and 10,240 MB of memory, and the CPU share scales with the memory you choose, up to six vCPUs. Lambda bills per millisecond of execution and charges a per-request fee. Deployment packages are limited to 50 MB zipped when uploaded directly and 250 MB unzipped, while container images can be up to 10 GB.
Lambda handles one request at a time in each execution environment. Concurrency comes from running more environments, which is why the regional concurrency limit matters for high-traffic workloads. The default is 1,000 concurrent executions per region, and new accounts can have lower limits. For a hands-on walkthrough, see how to create an AWS Lambda function in Python.
Azure Functions and its hosting plans
Azure Functions became generally available in November 2016. The hosting plan you choose sets much of the behavior:
- Consumption: Pay per execution and scale to zero. This plan has a default timeout of 5 minutes, with a maximum of 10 minutes.
- Flex Consumption: A newer plan, generally available since November 2024, designed to combine scale-to-zero with more control over instance behavior.
- Premium: Keeps pre-warmed instances ready, which reduces cold starts. Its default timeout is 30 minutes and can be set to unbounded.
- Dedicated: Runs functions on an App Service plan. It behaves like always-on compute, billed as App Service.
One detail catches many teams. HTTP-triggered functions are cut off at about 230 seconds by the load balancer in front of them, no matter what timeout the plan allows. For long-running work, use a non-HTTP trigger or a queue, and let the function report results later.
Google Cloud Functions, Cloud Run functions, and Cloud Run
Google Cloud Functions became generally available in 2018. In August 2024 Google renamed it Cloud Run functions. Cloud Run functions is built on Cloud Run, so the two are closely related.
Cloud Run is a separate service that runs any container that serves HTTP requests or handles events. It is based on Knative, scales to zero, and can run code written in any language your container supports. Cloud Run became generally available in November 2019. Cloud Run functions is the simpler option when you want to deploy a single function, while Cloud Run suits full applications packaged as containers. If you are weighing Cloud Run against Google’s older platform service, read Google App Engine vs Cloud Run.
Cloud Run functions allows HTTP functions up to 60 minutes and event-driven functions up to 9 minutes. The free allowance includes 2 million invocations per month.
Limits that shape your design
The limits are where the platforms differ most, so check them before you commit:
- Timeouts: A batch job that runs for 20 minutes will not fit a Lambda function, but it may fit Azure Premium or Cloud Run functions for HTTP requests up to 60 minutes. Azure HTTP triggers have the 230-second cutoff described above.
- Package size: Lambda’s 250 MB unzipped limit can affect projects with large machine learning libraries. Container images give more room, up to 10 GB on Lambda.
- Concurrency: Cloud Run can handle many concurrent requests in a single instance, which can make it efficient for I/O-heavy APIs. Lambda’s model is one request per environment.
- Temporary storage: Lambda provides up to 10 GB of /tmp space, which is useful for processing files.
Cold starts and how to reduce them
A cold start happens when the platform has to create a new instance before running your code. The delay depends on the runtime, the size of the package, and the configuration, including whether the function connects to a private network.
Each platform has options to reduce the impact:
- Lambda: Provisioned Concurrency keeps a set number of environments initialized, billed separately. SnapStart restores a saved snapshot of the initialized environment. It first supported Java in 2022 and added Python and .NET in late 2024. AWS also reworked VPC networking for Lambda in 2019, which reduced cold-start delays for functions attached to a VPC.
- Azure Functions: The Premium plan keeps pre-warmed instances, and Flex Consumption offers its own options for instance behavior.
- Cloud Run: You can set a minimum number of instances so some stay warm, at the cost of paying for them while idle.
Cold starts matter most for user-facing requests. They matter less for background jobs, where a delay of a second or two is usually acceptable.
When serverless costs more
Serverless is priced for variable and spiky traffic. For a steady, high-volume workload that runs all day, a container or a virtual machine can cost less, because you pay for capacity you keep busy. A common pattern is to start with functions for a new product, then move a steady, heavy service to containers once traffic is predictable.
Free allowances help small projects. They do not cover sustained production traffic, and the per-request and per-GB-second charges add up. For a broader view of how each provider prices storage, egress, and commitments, see the cloud pricing comparison.
Triggers, events, and workflows
Functions rarely run alone. They are usually triggered by events and chained together:
- Event routing: Amazon EventBridge, Azure Event Grid, and Google Eventarc route events from services and applications to functions.
- HTTP entry points: Lambda functions can be exposed through API Gateway or a function URL. Azure HTTP triggers are often paired with API Management. Cloud Run services get an HTTPS URL.
- Workflows: AWS Step Functions, Azure Durable Functions, and Google Cloud Workflows coordinate multi-step processes, retries, and waits.
If you already use containers, the managed Kubernetes comparison covers the other side of the tradeoff. For Google’s serverless container platform in context, see what Google Cloud Platform is used for.
Guardrails: concurrency limits and budgets
Serverless can scale faster than a budget review. A recursive trigger, where a function writes to the same bucket or queue that triggers it, can create runaway invocations. Each platform lets you cap concurrency or the maximum number of instances. Set those caps and create budget alerts before you put a function on a public endpoint or in a loop with a queue.
Choose the platform that matches your workload’s limits, not the one that is easiest to start with. Test the timeout, memory, and cold-start behavior with a realistic payload before you commit.