Limits, Pricing & When Not to Use Lambda

The numbers that shape your design, and the signs a job is too big for Lambda.

2 min read

Key limits

LimitValue
Maximum run time15 minutes per invocation
Memory128 MB – 10,240 MB (CPU scales up with memory)
Temporary disk (/tmp)512 MB by default, configurable up to 10 GB
Deployment package50 MB zipped for direct upload, 250 MB unzipped. Container images up to 10 GB.
Synchronous request/response payload6 MB
Concurrency1,000 simultaneous runs per Region by default (can be raised)

How pricing works

You pay for requests plus compute time measured in GB-seconds (memory × duration). A 512 MB function running for 1 second uses 0.5 GB-seconds. There's also a monthly free allowance. Check the Lambda pricing page for current numbers in your Region.

Tip

More memory also means more CPU. A CPU-heavy function often runs so much faster at 1 GB than at 128 MB that it ends up cheaper overall. Test a few settings.

Great fits

  • APIs and webhooks
  • Reacting to uploads, queue messages, and database changes
  • Scheduled jobs (nightly cleanup, reports)
  • "Glue" between services, such as calling an AI model and saving the result

Poor fits

  • Jobs that run longer than 15 minutes: use AWS Fargate, AWS Batch, or Step Functions to split the work
  • Heavy ML training or anything that needs a GPU: use SageMaker or EC2
  • Steady, high, around-the-clock traffic, where a server you keep running can be cheaper

Key takeaways

  • 15 minutes, 10 GB of memory, and 6 MB synchronous payloads are the big limits.
  • Cost = requests + GB-seconds. More memory can make functions faster and cheaper.
  • Long-running or GPU jobs belong on Fargate, Batch, SageMaker, or EC2.

Check your understanding

Pick an answer to see the explanation.

  1. 1. A video-processing job takes 40 minutes. What should you do?

  2. 2. Raising a function's memory from 128 MB to 1 GB also…