Which actions should the developer take to reduce the cold start time?
(Choose two.)
Add a dependency injection framework to the project.
Reduce the deployment package by including only the needed modules.
Configure provisioned concurrency for the Lambda functions.
Increase the timeout setting for the Lambda functions.
Change the Lambda invocation mode from synchronous to asynchronous.
Explanations:
Adding a dependency injection framework typically adds overhead to the initialization process, which could increase cold start times rather than reduce them.
Reducing the deployment package by including only the needed modules helps minimize the Lambda function’s initialization time, thereby reducing cold start times. Smaller packages lead to quicker startup.
Provisioned concurrency ensures that a set number of Lambda instances are always ready to serve requests, reducing cold start times by eliminating the need to initialize a new instance when a request is made.
Increasing the timeout setting does not affect the cold start time. It only allows the function to run longer, but it doesn’t reduce the initialization overhead when the function is invoked.
Changing the invocation mode from synchronous to asynchronous does not impact cold start times. Cold start refers to the initialization time, which occurs regardless of the invocation mode.