O'Reilly logo

DevOps for Serverless Applications by Shashikant Bangera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code for cold and warm containers

The performance of the lambda function is dictated by the logic that we code within it and the dependencies we call. So the best practice to code the lambda function would be to consider the cold and warm start of the containers.

For improved performance for warm starting the container, make sure that you store and reference any externalized configurations or dependencies that your code retrieves locally. Limit the reinitialization of the variables/objects on every invocation that uses global and static variables. Keep the HTTP and database connections alive.  

For better performance for cold starting the container, it is always better to use the default network environment, unless connectivity to a resource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required