Search code examples
google-app-enginestartup

Google App Engine take long time to process Request for the first time after Redeployment?


In my Google app engine project every time i redeploy the project and make request for the first time it take around 1.5 sec to perform the operation. but in next request it takes only 0.196 sec time.

As Example: When i query on data-store to retrieve list of data Time-stamp are:

1st Request(Around 1.5 sec)             2nd Request(Around 0.196 sec)
Start Time  1399448227701               Start Time  1399448369720
End Time    1399448229292               End Time    1399448369916

So my question is why app engine take too much time to respond for the first time after Redeployment??

Thanks In Advance.!!!


Solution

  • Well it can depend on several things, but most likely it corresponds with the time needed for your instance to start, it's called a loading request. Once the instance is started, the next requests are much more faster.

    You observe this after redeployment, but you can also see the same behaviour if your App Engine instance is idle for a too long time (no requests received), then it shuts down and the next request coming will have to wait for a new instance to start.

    You can change the idle time setting along with some other stuff like number of instances always on (resident instances) etc.. Fine tuning these is your best option.

    Check the documentation here it explains a lot about this.