Google App Engine - How can I improve JVM time for cold start?

I'm not new to improving my cold start time, I spent many hours trying different things. I would like, if possible, to find out exactly what the Google App Engine does during a cold start.

I have a log statement described here http://code.google.com/intl/nl/appengine/kb/java.html#performance to show when my code first gets control.

I have two applications that I tested, one of them is simple, and my code first takes control after about 1 second.

In the other, there are a lot of files and stuff, and my code first takes control after about 2 seconds. This one doesn't use more libraries than the other, but it has a lot more jsps and java classes.

Can it just have more java and jsp classes cause a slow cold start even if the class is not in use?

+4
source share
2 answers

This article is a pretty good resource. A little later after the journal report part:

How to speed up query loading?

Here are some suggestions:

  • Initializing the application is lazy, not impatient, so this is not all happening in a single request.
  • Share expensive initialization between JVMs. For example, put data that is expensive to read or compute in memcache, where it can be quickly read by other JVMs at startup.
  • To transfer initialization from the moment the application is launched to the build time, when it is reasonable. For example, convert a complex data file into a simple, fast-read data file during the build process.
  • Use more subtle dependencies. For example, prefer a library optimized for your task, as opposed to a large library that does very heavy initialization.
+2
source

Source: https://habr.com/ru/post/1304376/


All Articles