Cold boot on appengine with java8 takes longer time when compared to java7

314 views
Skip to first unread message

Nilson Pontello

unread,
Sep 12, 2017, 10:28:34 AM9/12/17
to Google App Engine
I've deployed the helloworld samples on appegine standard using java7 and java8 runtimes and noticed that java8 takes in average 6 times longer to spin up a new instance. I've used B1 instances on my tests but noticed the same on B2 as well and I am not willing to use more expensive instance classes because currently I have no traffic at all.

is it because java8 is still BETA or a limitation that we should consider regarding java8?

Many thanks

George (Cloud Platform Support)

unread,
Sep 12, 2017, 1:13:00 PM9/12/17
to Google App Engine
Hello Nilson, 

How did you test for delays when spinning up new instances, exactly? A step-by-step procedure would come handy for us, when trying to reproduce the issue. There is no indication of such a situation in documentation, nor other similar reports. Did you deploy exactly the same app for both versions, and with similar threading settings? 

Nilson Pontello

unread,
Oct 9, 2017, 6:46:33 PM10/9/17
to Google App Engine
Hi George,

You can try the attached sample. It implements a simple helloworld servlet.

In order to deploy using java7:
In order to deploy using java8:
  • Extract the files
  • Change from java7 to java8 inside appengine-web.xml
  • mvn appengine:deploy -Dapp.stage.enableQuickstart
  • open https://test-dot-<project_id>.appspot.com/java8
Bellow my results:


I did this experiment several times and I concluded that GAE takes around 2 seconds to spin up a new instance using java7 and between 5 to 6 seconds to spin up the same code using java8. This time is used by GAE before my code is executed.


You can run this as many times as you want and you will get similar results. Results will be the same even if you use F4_1G instance class.


Of course warmup requests can mitigate this problem, but I would  like to know if java8 cold boot time is expected to be 3 times longer than java7.


Many thanks

helloworld.zip

Nilson Pontello

unread,
Oct 16, 2017, 2:31:31 PM10/16/17
to Google App Engine
Hi George,

I've tried everything, including servlet 3.1, enableQuickstart, enableJarClasses, enableJarSplitting, etc... I can't reduce java8 startup time for a simple hello world servlet to be as fast as java7.
  1. Have you reproduced it from your side? 
  2. Should I consider that java8 takes longer time to spin up new instances than java7
  3. is this permanent limitation or can be somehow optimized?
Thanks

Nilson Pontello

unread,
Oct 19, 2017, 9:27:36 AM10/19/17
to Google App Engine
I am giving  up this thread.

Tried first from stack overflow, then here, now I am moving to the issue tracker.


Regards

Kunal Dabir

unread,
Mar 24, 2018, 1:01:28 PM3/24/18
to Google App Engine
I have starred the issue you have created but I don't have a lot hopes on that issue.

I have also observed the similar behavior for both my java and groovy apps. Upgrading to java8 makes the cold boot lot more worse than it already was. I am seeing times in order of 7-10 seconds for hello world app. 

I think JVM is actually getting better with so I don't think it can be attributed to Java8 itself. However, here are some of my guesses

1. servlet 3.1 upgrade might be scanning classpath for annotations @WebFilter etc..
2. Java8 GAE/J also removed whitelisting, which essentially could mean more classes/impl ending up on path.
3. Or there is really slow container boot, nothing to do with JVM in this case. For example, the http request was received at 15:43:28.721 but first log that JVM spit out was at 15:43:39.520, now i know by testing locally, JVM startup does not take 10 secs for my app, may be 2-3 secs in worse case. So I'd attribute these extra seconds to non-JVM stuff.

Google should really profile the differences between the two runtime environments and work towards improving cold boot time for Java8.
Reply all
Reply to author
Forward
0 new messages