前端实例热身,尽管空闲实例已定义 [英] Frontend instances warmups although idle-instance is defined

查看:95
本文介绍了前端实例热身,尽管空闲实例已定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个启用了帐单的AppEngine应用程序。我还设置了一个空闲实例,并将挂起延迟设置为500毫秒。



问题是我得到了很多新的前端实例热身:


此请求导致您的应用程序启动一个新进程,从而导致您的应用程序代码首次加载。这个请求可能需要更长的时间,并且使用的CPU比典型的应用程序请求多。


这很令人惊讶,主要是因为它通常发生在尽管我设置了一个空闲实例,但几分钟没有任何活动。即使设置了2个空闲实例,问题也没有解决。



这给我们的客户带来了很多挫折。任何帮助将不胜感激。



谢谢,
吉拉德。



编辑:



附上日志:

  2013-01-29 15:00:09.569 / gwtRequest 200 1169ms 0kb Mozilla / 5.0(Windows NT 5.1)AppleWebKit / 537.17(KHTML,像Gecko)Chrome / 24.0.1312.56 Safari / 537.17 
I 2013-01-29 15:00:08.455 [s〜my- < stdout> ;: NamespaceFilter - 命名空间是:*******
I 2013-01-29 15:00:00调用:服务器RF:调用functionB()
I 2013-01-29 15:00:08.985 com。*。common.server.apis.MyService functionB:MyService-functionB:statId:95001; someBean-ID:950010000001666; someBean-o
I 2013-01-29 15:00:09.564 com。*。common.server.apis.MyService functionB:MyService-functionB-finish:
2013-01-29 15:00: 08.198 / gwtRequest 200 15664ms 0kb Mozilla / 5.0(Windows NT 5.1)AppleWebKit / 537.17(KHTML,如Gecko)Chrome / 24.0.1312.56 Safari / 537.17
I 2013-01-29 14:59:59.928 com.google。 inject.internal.util。$ FinalizableReferenceQueue $ SystemLoader loadFinalizer:不允许访问系统类加载器。
I 2013-01-29 14:59:59.957 com.google.inject.internal.util。$ FinalizableReferenceQueue< init> ;:无法启动引用终结器线程。参考清理将只发生在
I 2013-01-29 15:00:03.164 [s〜my-appengine-app / 5.364695570610280531]。< stdout> ;: TRACE:清单文件jar:file:/ base / data /home/apps/s~my-appengine-app/5.364695570610280531
I 2013-01-29 15:00:03.166 [s〜my-appengine-app / 5.364695570610280531]。< stdout> ;: INFO:Hibernate Validator 4.1.0.Final at org.hibernate.validator.util.Version。(Version.java:
I 2013-01-29 15:00:03.194 [s〜my-appengine-app / 5.364695570610280531]。< stdout> ;: DEBUG:在classpath上找到javax.persistence.PersistenceUtil at org.hibernate.validator.engin
I 2013-01-29 15:00:03.199 [s〜my-appengine-app / 5.364695570610280531]< ; stdout>:INFO:实例化org.hibernate.validator.engine.resolver.JPATraversableResol的一个实例
I 2013-01-29 15:00:03.209 [s〜my-appengine-app / 5.364695570610280531]。< stdout> ;: DEBUG:找不到META-INF / validation.xml。仅在org.hib中使用基于注解的配置
I 2013-01-29 15:00:03.860 [s〜my-appengine-a < stdout> ;: NamespaceFilter - namespace是:*******
I 2013-01-29 15:00:07.796 com。*。common.server.rf.LogServiceLayerDecorator invoke:服务器RF:调用函数A()
I 2013-01-29 15:00:07.967 com。*。common.server.apis.MyService functionA:MyService-functionA:amountInCents:1100; ID:-1799069631; statId:95001
I 2013-01-29 15:00:08.197此请求导致您的应用程序启动一个新进程,从而导致您的应用程序代码首次加载。这需要
2013-01-29 14:49:01.044 / gwtRequest 200 740ms 0kb Mozilla / 5.0(Windows NT 5.1)AppleWebKit / 537.17(KHTML,如Gecko)Chrome / 24.0.1312.56 Safari / 537.17
I 2013-01-29 14:49:00.365 [s〜my-appengine-app / 5.364695570610280531]。< stdout> ;: NamespaceFilter - namespace is:*******
I 2013-01-29 14:49:00.411 com。*。common.server.rf.LogServiceLayerDecorator invoke:Server RF:Calling functionB()
I 2013-01-29 14:49:00.425 com。*。common.server.apis。 MyService函数B:MyService-functionB:statId:95001; someBean-ID:950010000001665; someBean-o
I 2013-01-29 14:49:01.032 com。*。common.server.apis.MyService functionB:MyService-functionB-finish:

正如你所看到的:
$ b $ 1)functionB()在14:49被调用



2)大约10分钟没有任何活动

3)functionA()在14:59:59被调用 p)
$ b $ 4 4)functionA()导致一个新的实例产生



5)下一次调用functionB()当对functionA()的调用结束时调用

解决方案

当idel实例提供请求时,将延迟设置为更高的数字会产生比您设置新实例的延迟更长的时间。



日志显示您有两个请求:一个需要740ms,另一个需要15.6秒,这意味着当740ms请求开始时,已经有一个请求处理(15.6之一),这会导致新实例加载。


I have an AppEngine application with billing enabled. I also set up 1 idle instance, and set the pending-latency to 500ms.

The issue is that I get quite a lot of new frontend instance warmups:

This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

This is surprising mostly because it usually happens after a few minutes of no activity although I set up an idle instance. Problem didn't resolve even when 2 idle instances were set.

This is causing a lot of frustration to our customers. Any help would be greatly appreciated.

Thanks, Gilad.

EDIT:

Attaching the logs:

2013-01-29 15:00:09.569 /gwtRequest 200 1169ms 0kb Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
I 2013-01-29 15:00:08.455 [s~my-appengine-app/5.364695570610280531].<stdout>: NamespaceFilter - namespace is: *******
I 2013-01-29 15:00:08.976 com.*.common.server.rf.LogServiceLayerDecorator invoke: Server RF: Calling functionB()
I 2013-01-29 15:00:08.985 com.*.common.server.apis.MyService functionB: MyService-functionB: statId: 95001; someBean-Id:950010000001666; someBean-o
I 2013-01-29 15:00:09.564 com.*.common.server.apis.MyService functionB: MyService-functionB-finish:
2013-01-29 15:00:08.198 /gwtRequest 200 15664ms 0kb Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
I 2013-01-29 14:59:59.928 com.google.inject.internal.util.$FinalizableReferenceQueue$SystemLoader loadFinalizer: Not allowed to access system class loader.
I 2013-01-29 14:59:59.957 com.google.inject.internal.util.$FinalizableReferenceQueue <init>: Failed to start reference finalizer thread. Reference cleanup will only occur when
I 2013-01-29 15:00:03.164 [s~my-appengine-app/5.364695570610280531].<stdout>: TRACE: Manifest file jar:file:/base/data/home/apps/s~my-appengine-app/5.364695570610280531
I 2013-01-29 15:00:03.166 [s~my-appengine-app/5.364695570610280531].<stdout>: INFO : Hibernate Validator 4.1.0.Final at org.hibernate.validator.util.Version.(Version.java:
I 2013-01-29 15:00:03.194 [s~my-appengine-app/5.364695570610280531].<stdout>: DEBUG: Found javax.persistence.PersistenceUtil on classpath. at org.hibernate.validator.engin
I 2013-01-29 15:00:03.199 [s~my-appengine-app/5.364695570610280531].<stdout>: INFO : Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResol
I 2013-01-29 15:00:03.209 [s~my-appengine-app/5.364695570610280531].<stdout>: DEBUG: No META-INF/validation.xml found. Using annotation based configuration only at org.hib
I 2013-01-29 15:00:03.860 [s~my-appengine-app/5.364695570610280531].<stdout>: NamespaceFilter - namespace is: *******
I 2013-01-29 15:00:07.796 com.*.common.server.rf.LogServiceLayerDecorator invoke: Server RF: Calling functionA()
I 2013-01-29 15:00:07.967 com.*.common.server.apis.MyService functionA: MyService-functionA: amountInCents: 1100; Id:-1799069631; statId:95001
I 2013-01-29 15:00:08.197 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This requ
2013-01-29 14:49:01.044 /gwtRequest 200 740ms 0kb Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
I 2013-01-29 14:49:00.365 [s~my-appengine-app/5.364695570610280531].<stdout>: NamespaceFilter - namespace is: *******
I 2013-01-29 14:49:00.411 com.*.common.server.rf.LogServiceLayerDecorator invoke: Server RF: Calling functionB()
I 2013-01-29 14:49:00.425 com.*.common.server.apis.MyService functionB: MyService-functionB: statId: 95001; someBean-Id:950010000001665; someBean-o
I 2013-01-29 14:49:01.032 com.*.common.server.apis.MyService functionB: MyService-functionB-finish:

As you can see:

1) functionB() is called on 14:49

2) No activity for around 10 minutes

3) functionA() is called at 14:59:59

4) functionA() causes a new instance to spawn

5) the next call to functionB() is only called when the call to functionA() ends

解决方案

Set the latency to a higher number, once the idel instance serves a request for longer than the latency you set a new instance will be spawned.

The logs show that you have two requests: one that took 740ms and one that took 15.6 seconds, which means that when the 740ms request started there was an already a request processing (the 15.6 one) which cause a new instance to be loaded.

这篇关于前端实例热身,尽管空闲实例已定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆