Why does the client create a new instance in GAE immediately after the warm-up request

I use GAE for my little service. I only have 3 or 4 clients per day and never at the same time. My service is written in Java using spring MVC, spring security and objectification. Thus, the startup time can take from 15 to 20 seconds.

To avoid this startup delay for my client, I activate billing and set the minimum wait example to 1 (and 1 for max). But even with this configuration, sometimes my client has to wait 15 seconds for their first request.

As you can see in my log immediately after the warm-up request (never used), the client starts a new instance (never used later):

Example 1:

2012-09-10 23:23:31.442 /myIndex.do 200 18997ms 15kb Mozilla xxxx - - [10/Sep/2012:14:23:31 -0700] "GET /myIndex.do HTTP/1.1" 200 15048 - "Mozilla" "www.mysite.fr" ms=18997 cpu_ms=10442 cpm_usd=0.001682 loading_request=1 instance=00c61b117c2e937c04807734919256d8a5cee8 2012-09-10 23:05:05.260 /_ah/warmup 200 14225ms 0kb 0.1.0.3 - - [10/Sep/2012:14:05:05 -0700] "GET /_ah/warmup HTTP/1.1" 200 0 - - "3.360029581669528772.mywebsite.appspot.com" ms=14225 cpu_ms=8969 loading_request=1 instance=00c61b117c10680b3f12b4c8f80f7b7191ce8bab 

Example 2:

 2012-08-31 18:51:16.096 /myIndex.do 200 14676ms 14kb Mozilla xxxx - - [31/Aug/2012:09:51:16 -0700] "GET /myIndex.do HTTP/1.1" 200 14954 "http://www.mysite.fr/myIndex.do" "Mozilla" "www.mysite.fr" ms=14676 cpu_ms=8514 cpm_usd=0.001671 loading_request=1 pending_ms=1022 instance=00c61b117cf69060fbcfbfe9dbd6ed735b869817 2012-08-31 18:39:43.895 /_ah/warmup 200 19812ms 0kb 0.1.0.3 - - [31/Aug/2012:09:39:43 -0700] "GET /_ah/warmup HTTP/1.1" 200 0 - - "3.360029581669528772.mysite.appspot.com" ms=19812 cpu_ms=10243 loading_request=1 instance=00c61b117c1d4303f8698a615149d5a40dcac7 

It bothers me that I already have this problem with 4 clients: /

and also found a similar problem http://code.google.com/p/googleappengine/issues/detail?id=7865

Can anyone confirm if these two issues are related?

thanks

Samuel

+4
source share
1 answer

I'm not sure I can answer your question correctly, but I will do my best to put you on the right track.

Warmup requests are called by the application server before "live", the request is sent to your application instance. This is the ability to call / initialize as much code as possible so that it is loaded into memory. When a live request accesses your application, it runs quickly. Looking at your logs, the request to /myIndex.do takes 14 seconds to complete. By any standard, this is quite a long time.

This leads me to the following:

  • Try to find out which libraries you import so that the request is so long. Once you have installed this, make sure you download / use them in your warm-up handler.
  • If this is not a problem loading the library, it means that you are doing a lot of processing in your request. I would suggest delegating some of them to asynchronous handlers (using AJAX).
  • Finally, you could set a schedule to call your /myindex.do regularly (every minute or so) to make sure it's hot.
0
source

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


All Articles