Skill 1.2.6

Tune Lambda functions for optimal performance

Key Concepts

Because CPU scales with memory, increasing memory often makes a function faster and can lower total cost. The open-source AWS Lambda Power Tuning tool runs a function at different memory sizes to find the best balance, and the maximum memory used in each REPORT log line shows how much headroom remains.

To reduce latency, initialise SDK clients and connections outside the handler so warm invocations reuse them, keep deployment packages small, and load only the dependencies you need. Provisioned concurrency or SnapStart remove most cold-start delay. Choosing the Arm-based Graviton architecture often gives better price-performance.