Optimise Lambda with cold start strategies, Provisioned Concurrency, Lambda Layers, function URLs, and SnapStart for JVM workloads.
0 / 5 completed
1 / 5
What causes an AWS Lambda cold start and how does it affect latency?
Cold start: Lambda reuses warm execution environments for subsequent invocations, so cold starts occur when there are no available environments (new deployments, traffic spikes, scale-out). Mitigation strategies include keeping functions warm with scheduled pings, reducing package size, and using Provisioned Concurrency for latency-sensitive workloads.
2 / 5
What does Provisioned Concurrency solve for AWS Lambda?
Provisioned Concurrency: you configure it per function version or alias: aws lambda put-provisioned-concurrency-config --function-name MyFn --qualifier prod --provisioned-concurrent-executions 10. Those 10 environments stay initialised at all times. Use it for API endpoints where P99 latency is critical and cold start spikes are unacceptable.
3 / 5
What are Lambda Layers and what problem do they solve?
Lambda Layers: without layers, each function must bundle its own copy of shared libraries (e.g. numpy, pandas). A layer is created once, published with a version ARN, and referenced by multiple functions. Functions can attach up to 5 layers. Layers are extracted into /opt and available on the runtime's module search path.
4 / 5
What is a Lambda function URL and when is it preferred over API Gateway?
Function URLs: enabled per function, they provide a stable https://<id>.lambda-url.<region>.on.aws endpoint. They support IAM auth or no auth (NONE). For a simple webhook receiver or internal microservice, function URLs avoid the complexity and cost of API Gateway while still supporting streaming responses and CORS configuration.
5 / 5
What is Lambda SnapStart and which runtimes does it target?
SnapStart: Java Lambda cold starts are slow because the JVM must load classes and run @PostConstruct initialisation. SnapStart runs the init phase once, captures a Firecracker microVM snapshot, and subsequent cold starts restore from that snapshot in ~300ms instead of several seconds. Enable it by setting SnapStart: ApplyOn: PublishedVersions.