Cold-starting a function

When the application has been freshly deployed, it is pretty easy to imagine that there will be no instances of the function that will be executing currently. When a new request comes in that asks for the functionality provided by the function we have just deployed on the infrastructure. Now, the cloud provider systems are notified that there are no running instances of the function that can handle the incoming request.

Once the provider system is made aware of the situation, it spawns up a new instance with the function code inside it. This instance now starts to execute the function based on the parameters provided in the request and a response is generated by the function and sent back to the requesting client.

Now, when the function finishes executing, the container holding the function instance is not terminated immediately. Instead, the provider waits for a pre-configured amount of time before it terminates the instance. This is done with the expectation that the same container instance can be used for handling another request, which will save some time which might be required to do a cold launch of the new function instance.

These cold starts increase the response times for clients when no instance is running to handle the incoming requests.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.239.226