GAE启动动态实例来为请求提供服务,而不是使用闲置的驻留实例 [英] GAE Starting dynamic instance to serve requests instead of using idle resident instances

查看:127
本文介绍了GAE启动动态实例来为请求提供服务,而不是使用闲置的驻留实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查了一堆关于这个问题的其他帖子:Resident instance似乎并不奏效,但我无法找到适合我的问题的解决方案。



我有4个F2驻留,每当有人前往我的应用程序时,不是使用驻留实例,而是装入一个新的动态实例来回答请求。所以试图使用我的应用程序的人将等待20秒。然后所有新的请求都会到达新的动态实例。
我的驻留实例的响应时间低于我的最低等待时间(5秒)。
我的应用程序自昨天开始生产,如果没有人在5分钟内使用它,那么下一个连接的人将需要等待20秒!

从我读过的内容可以看出,如果我将最小空闲实例设置为4(为了让我的驻留实例)GAE将尝试拥有4个空闲实例所有的时间,所以我们将开始新的实例;但之后我总是需要等待35秒才能开始第一次连接。使用应用程序2分钟后,一切都很好。
在Google工作的一个人告诉我,驻留实例管理存在一个错误,我必须有3个驻留实例才能为我的用户快速回答问题。
我确定我没有理解什么。任何人都可以帮我让我的用户有一个公平的响应时间,当他们连接到我的应用程序,并没有人连接5分钟,请?



非常感谢您

解决方案

检查GAE邮件列表谷歌小组,你会看到这个问题一遍又一遍地出现。



简短的回答是,GAE是为高负载设计的。虽然我没有真正看到尖峰的正式定义,但驻留实例存在可以处理工作负载的峰值。如果GAE的神秘负载均衡算法不会将您的流量确定为高峰期,那么您将获得一个新的动态实例。



如果您向您应用程序,然后他们中的一些将被定向到驻留实例,同时等待动态实例启动。



没有太多的事情可以做,但加入长长的清单对此抱怨的人。至少有两个问题涉及此问题:



https://code.google.com/p/googleappengine/issues/detail ?id = 7865& q = scheduler& colspec = ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

< a href =https://code.google.com/p/googleappengine/issues/detail?id=7706&q=scheduler&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner% 20Logrel =nofollow> https://code.google.com/p/googleappengine/issues/detail?id=7706&q=scheduler&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language% 20Priority%20Owner%20Log

或者,您可以重新编写应用程序,以确保您没有20秒的启动时间。有几件事情你可以做,比如推迟大部分的加载,但是在Java中做是件痛苦的事情。

另外,python和Go运行时似乎启动了快得多。


I ve checked a bunch of other post about the same subject like this one : "Resident instance doesn't seem to work" but I couldn t find a working answer for my problem

I have 4 F2 resident and whenever someone goes to my application, instead of using a resident instance, a new dynamic instance is mounted to answer the request. And so the person who is attempting to use my application will wait 20 seconds. Then all the new requests will come to the new dynamic instance. The response time on my resident instances are inferior to my min pending latency (5 sec). My app is in production since yesterday and if no one uses it for 5 minutes then the next guy who will connect will have to wait 20 sec !

From what I ve read, some would say that if I set min idle instance to 4 ( in order to have my resident instances) GAE will try to have 4 iddle instances all the time and so we ll start new instances; but then I would always have to wait 35 sec for all my first connections After 2 minutes of using the application everything is fine. A guy working at Google told me that there is a bug in the management of resident instances and that I have to have 3 resident instances to have a quick answer for my users. I m sure I haven t understood something. Anyone could help me let my users have a fair response time when they connect to my application and no one have connected for 5 minutes please ?

Thank you very much

解决方案

Check the GAE mailing list on google groups, you'll see this question come up over and over and over again.

The short answer is, GAE is designed for high loads. Resident instances exist to handle spikes in workloads, although I haven't really seen a formal definition of a "spike". If GAE's mysterious load balancing algorithm doesn't determine your traffic as a spike, you'll get a new dynamic instance.

If you throw hundreds or thousands of requests at your app, then some of them will get directed to the resident instances while waiting for dynamic instances to spin up.

There's not too much you can do but join the long list of people who have complained about this. There's at least two issues filed against this:

https://code.google.com/p/googleappengine/issues/detail?id=7865&q=scheduler&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

https://code.google.com/p/googleappengine/issues/detail?id=7706&q=scheduler&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

Alternatively you can rewrite your app so that you don't have a 20s startup time. There's a few things you can do, like defer much of your loading, but it's painful to do in Java.

As another aside, python and Go runtimes seem to start up much faster.

这篇关于GAE启动动态实例来为请求提供服务,而不是使用闲置的驻留实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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