0
votes

Cold start for aws gateway + lambda from different applications.

I tried to keep the lambda container warm by hitting the api gateway from a different lambda(in parallel for 10 threads). This helps with the subsequent call from the the lambda.

Now when I call from and android app(after warming using the above lambda). It still takes 5 sec for cold start for the first call. subsequent calls are fast again.

My expectation is that if I hit(in parallel for multiple containers) the container and heat it enough, all the apps should not experience cold starts.

Is this expectation valid? Or does lambda has different containers for different applications?

1
Each lambda will have its own set of containers. - cementblocks
To be more precise: Assume the following sequential calls 1) Postman->lambda1 2) Lambda2->lamda1 3) androidApp->lambda1 In these cases does the container for lambda1 is different or is it same. I am observing cold start happening in each of these cases. - tharun
lambda1 will share it's set of containers. Is your lambda running inside a VPC? - cementblocks
No, its not running inside a VPC. - tharun

1 Answers

0
votes

The issue was not with aws lambda cold start but with Retrofit in android taking too long for the first call. This is because its taking too long for dns resolution.

Below is the stacktrace why trying to hit "https://google.com":

REQUEST 1 (new connection)

0.000 callStart

0.007 dnsStart

5.048 dnsEnd

5.049 connectStart

5.056 secureConnectStart

5.106 secureConnectEnd

5.108 connectEnd

5.109 connectionAcquired

5.110 requestHeadersStart

5.112 requestHeadersEnd

5.196 responseHeadersEnd

5.197 responseBodyStart

REQUEST 1 (new connection) end success