Separate the Lambda handler from your core logic. ...
Take advantage of execution environment reuse to improve the performance of your function. ...
Use a keep-alive directive to maintain persistent connections. ...
Use environment variables to pass operational parameters to your function.
https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html