0

I have an app engine application with some services being based on webapp2 framework and some service being based on endpoints-v2 framework.

The issue that i am facing over is that some time the OPTIONS request being sent from front end takes a huge amount of time get the response back which varies from 10 secs to 15 secs which is adding latency to my entire application. On digging down deeper into the issue and found the it is due to instance startup time that is costing us this much latency.

So my question is Does starting up an instance takes this much of time ? If not then how can i reduce my startup time for instances ? How the instances start so that i can optimise those situations in my code?

  • Without the code is hard to comment. These may help: https://stackoverflow.com/questions/34635012/what-determines-start-up-time-of-dynamic-instance-and-can-it-vary-between-weeks/34637044#34637044, https://stackoverflow.com/questions/33453441/app-engine-few-big-scripts-or-many-small-ones?noredirect=1&lq=1 – Dan Cornilescu Jun 24 '18 at 01:30
  • Thank you for your reply. I had gone through your link and it was found that request that made the instances to start, files related to that request will only be loaded but m not sure in case of endpoints the url declared in app.yaml as **"/_ah/api"** for all API's. Does it loads all API's if any endpoint API is called? – Yugansh Marwah Jun 24 '18 at 13:05
  • That depends on the code. – Dan Cornilescu Jun 25 '18 at 04:43
  • Thanks Dan. Had followed may articles and found the exact issue. – Yugansh Marwah Jun 25 '18 at 09:47

1 Answers1

1

Java instance takes a long time to spin up. You can hide the latency by configuring warmup request and min-idle-instances (see here) in your appengine-web.xml.

N.F.
  • 3,844
  • 3
  • 22
  • 53