虽然定义了idle-instance,但前端实例是预热的

时间:2013-01-29 14:45:14

标签: java google-app-engine

我有一个启用了结算的AppEngine应用程序。我还设置了1个空闲实例,并将pending-latency设置为500ms。

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

  

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

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

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

谢谢, 吉拉德。

编辑:

附加日志:

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:

如你所见:

1)在14:49

上调用functionB()

2)大约10分钟没有活动

3)functionA()在14:59:59被调用

4)functionA()导致新实例产生

5)只有在对functionA()的调用结束时才会调用对functionB()的下一次调用

1 个答案:

答案 0 :(得分:0)

将延迟设置为更高的数字,一旦idel实例提供的请求超过您设置的延迟,将生成新实例。

日志显示你有两个请求:一个花了740毫秒,一个花了15.6秒,这意味着当740ms请求开始时,已经有一个请求处理(15.6一个)导致一个新实例加载。