我有一个启用了计费的 AppEngine 应用程序。我还设置了 1 个空闲实例,并将挂起延迟设置为 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, 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) functionB() 在 14:49 被调用
2) 10 分钟左右没有活动
3) functionA() 在 14:59:59 被调用
4) functionA() 导致产生一个新实例
5) 下一次对 functionB() 的调用仅在对 functionA() 的调用结束时调用