Google App Engine实例保持快速关闭状态 [英] Google App Engine Instances keep quickly shutting down

查看:90
本文介绍了Google App Engine实例保持快速关闭状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在使用应用程序引擎一段时间没有问题。我知道,如果应用程序未被访问者击中一段时间​​,那么该实例将关闭,并且第一个访问该网站的访问者将有几秒的延迟,而新的实例启动。



然而,最近似乎这些实例只能在很短的时间内(有时不到一分钟)保持活跃状态​​,并且如果我有一个实例已经启动并正在运行,并且我刷新一个应用程序网页,它仍然触发另一个实例(并且它启动的页面是最小的主页HTML,不需要太多的CPU /内存)。看看我的日志,它不断启动新的实例,这在以前从未如此。



关于我应该看什么的任何提示,或者为什么这是发生了什么?

另外,我正在使用Python 2.7,线程安全,python_precompiled,热身入站服务,NDB。



更新:



因此,我将我的应用程序更改为至少有一个空闲实例,希望这可以解决问题,但它仍然即使一个驻留实例已经运行,也会启动新的实例。因此,当只有1个驻留实例(并且除了我之外没有获得任何流量),并且我在我的应用中转到另一个页面时,它仍在启动一个新实例。



另外,我将Koma指出的Pending Latency改为1.5s,但这似乎没有帮助。

这些实例的内存使用量总是在53MB左右,当被调用的页面没有太多时,这是令人惊讶的。我正在使用F1前端实例类,并且有128个限制,但53MB看起来应该是高的。这是一个可接受的大小,当它第一次启动?



更新2:我刚刚在仪表板注意到,在过去的14个小时,请求/ _ah /热身响应24 404错误。这可能是相关的吗?为什么他们会以404响应状态响应?



主要问题:为什么它会不断启动新实例(即使没有流量)?尤其是那里已经存在的实例,为什么他们关闭得这么快?

解决方案

我的解决方案是增加待处理延迟时间

如果网页一次触发3个Ajax请求,AppEngine会为其他请求启动新的实例。配置最小挂起延迟时间 - 将其设置为2.5秒后,同一实例处理所有三个请求,并且吞吐量可以接受。我的b
$ b

我的项目仍然没有负载/流量...所以除了提高待处理延迟外,我还在Pingdom上打开了一个帐户,并将其配置为每分钟ping我的Appengine项目。



两者的结合,使得我有一个实例保持活跃,并且大部分时间都提供所有请求。它会在真正需要时扩展到新实例。


So I've been using app engine for quite some time now with no issues. I'm aware that if the app hasn't been hit by a visitor for a while then the instance will shut down, and the first visitor to hit the site will have a few second delay while a new instance fires up.

However, recently it seems that the instances only stay alive for a very short period of time (sometimes less than a minute), and if I have 1 instance already up and running, and I refresh an app webpage, it still fires up another instance (and the page it starts is minimal homepage HTML, shouldn't require much CPU/memory). Looking at my logs its constantly starting up new instances, which was never the case previously.

Any tips on what I should be looking at, or any ideas of why this is happening?

Also, I'm using Python 2.7, threadsafe, python_precompiled, warmup inbound services, NDB.

Update:

So I changed my app to have at least 1 idle instance, hoping that this would solve the problem, but it is still firing up new instances even though one resident instance is already running. So when there is just the 1 resident instance (and I'm not getting any traffic except me), and I go to another page on my app, it is still starting up a new instance.

Additionally, I changed the Pending Latency to 1.5s as koma pointed out, but that doesn't seem to be helping.

The memory usage of the instances is always around 53MB, which is surprising when the pages being called aren't doing much. I'm using the F1 Frontend Instance Class and that has a limit of 128, but either way 53MB seems high for what it should be doing. Is that an acceptable size when it first starts up?

Update 2: I just noticed in the dashboard that in the last 14 hours, the request /_ah/warmup responded with 24 404 errors. Could this be related? Why would they be responding with a 404 response status?

Main question: Why would it constantly be starting up new instances (even with no traffic)? Especially where there are already existing instances, and why do they shut down so quickly?

解决方案

My solution to this was to increase the Pending Latency time.

If a webpage fires 3 ajax requests at once, AppEngine was launching new instances for the additional requests. After configuring the Minimum Pending Latency time - setting it to 2.5 secs, the same instance was processing all three requests and throughput was acceptable.

My project still has little load/traffic... so in addition to raising the Pending Latency, I openend an account at Pingdom and configured it to ping my Appengine project every minute.

The combination of both, makes that I have one instance that stays alive and is serving up all requests most of the time. It will scale to new instances when really necessary.

这篇关于Google App Engine实例保持快速关闭状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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