SAA-C03 ยท Elastic compute performance
Lambda memory, concurrency and cold starts
Memory setting and proportional CPU, reserved versus provisioned concurrency, cold starts and ephemeral storage size.
Key points
- Memory 128-10,240 MB is the main lever: CPU scales with it, about one vCPU at 1,769 MB; CPU-bound code runs faster for little extra cost.
- /tmp: set separately, 512-10,240 MB. Max run: 15 minutes.
- Default 1,000 concurrent executions per Region, shared.
- Reserved concurrency: sets aside and caps a function's share; free.
- Provisioned concurrency: pre-initialized environments skip cold start (Init); paid.
- SnapStart also cuts cold starts.
Source: https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html
Practice questions
How do you give a Lambda function more CPU power?
- Increase the function's timeout
- Increase the function's memory setting
- Increase the ephemeral storage size
- Increase the reserved concurrency
Show answer
Answer: B. Increase the function's memory setting
Lambda has no separate CPU setting: it allocates CPU in proportion to the configured memory, so raising memory raises CPU. Timeout only allows longer runs, ephemeral storage only enlarges /tmp, and reserved concurrency controls how many copies run, not how fast each one is.
Which statements about reserved concurrency in AWS Lambda are correct?
- It caps how far the function can scale
- It guarantees capacity other functions cannot use
- It is configured at no additional charge
- It keeps environments initialized to avoid cold starts
- It adds extra concurrency on top of the account limit
Show answer
Answer: A. It caps how far the function can scale, B. It guarantees capacity other functions cannot use, C. It is configured at no additional charge
Reserved concurrency guarantees that number of concurrent executions for the function and also acts as its maximum, so it can protect a downstream database; it has no extra charge. It does not pre-initialize environments (that is provisioned concurrency), and the reserved amount is taken out of the pool that other functions can use rather than added to it.
Raising a CPU-bound Lambda function's memory from 512 MB to 2,048 MB always multiplies its cost by four, because Lambda bills by configured memory.
Show answer
Answer: False
False. Billing is memory multiplied by duration. Because CPU grows with memory, a CPU-bound function often runs much faster at a higher setting, so the total cost can rise far less than four times, or even stay about the same. Tools such as AWS Lambda Power Tuning help find the best setting.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
