Google App Engine自动缩放如何工作? [英] How does Google App Engine Autoscaling work?

查看:169
本文介绍了Google App Engine自动缩放如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google对他们的商业策略非常狡猾。这个问题是关于Google App Engine配额和实例的。



我部署了GAE应用程序,但没有指定任何具体的缩放算法。从他们的文档中,似乎默认是自动缩放。但是他们什么时候将应用扩展到另一个实例呢?什么请求导致第二个实例开始和流量被分裂?

另外,自动缩放提供每天28个空闲时间(并且这仅适用于前端实例),但后端实例每天提供9个小时(即使您只为手动缩放指定了1个实例,也可进行手动和基本缩放)。

所以现在如果你想免费使用一个小的GAE应用程序,你可以选择前端实例(因为如果你只需要一个实例的话,它们将是免费的)。但他们也有自动缩放功能! AHA!所以这意味着它们可以在你不知道的情况下进行扩展,并且你可以很容易地每天超过28小时。

所以我的问题是什么时候一个新的实例产生了? Google巧妙地避免了这个非常重要的问题的答案,直到他们将用户关闭为止:)

解决方案

事实上, 。



缩放动态实例


App Engine调度程序决定是否为每个新请求提供
使用现有的实例(无论是空闲的还是接受
的并发请求),将请求放入待处理的请求队列中,或
为该请求启动一个新实例。该决定考虑了
可用实例的数量,您的应用程序有多少
服务请求(其延迟),以及启动
a新实例需要多长时间。



每个实例都有自己的传入请求队列。 App Engine
监视每个实例队列中等待的请求数量。如果
App Engine检测到应用程序的队列由于负载增加而变得太长
,它会自动创建一个
应用程序的新实例来处理该负载。


可以调整自动缩放的参数,请参阅更改自动缩放性能设置缩放元素



如果您确实想要限制您可能必须使用的实例数量使用 max_instances 配置或手动缩放进行基本缩放。


Google is quite cunning about their business strategies. This question is about Google App Engine quotas and instances.

I deployed a GAE app without specifying any specific scaling algo. From their docs, it seems like the default is auto-scaling. But when do they scale the app to another instance? What request/s causes the second instance to get started and traffic to be split?

Also, just so happens that auto-scaling offers 28 free hours a day (and this is only possible for frontend instance), but backend instances offers 9 hours a day (with manual and basic scaling, even if you specify just 1 instance for manual scaling).

So now if you want to use a small GAE app for free, you'd opt for frontend instances (since they'd be free if there's only one instance of them you need). But they also have auto scaling enabled! AHA! So that means they could scale without you knowing and you could easily overshoot 28 hours a day.

So my question is when does a new instance spawn exactly? Google cleverly avoids an answer to this very important question until they've ripped users off :)

解决方案

Actually it is fairly well explained.

From Scaling dynamic instances:

The App Engine scheduler decides whether to serve each new request with an existing instance (either one that is idle or accepts concurrent requests), put the request in a pending request queue, or start a new instance for that request. The decision takes into account the number of available instances, how quickly your application has been serving requests (its latency), and how long it takes to spin up a new instance.

Each instance has its own queue for incoming requests. App Engine monitors the number of requests waiting in each instance's queue. If App Engine detects that queues for an application are getting too long due to increased load, it automatically creates a new instance of the application to handle that load.

It is possible to tune the parameters for autoscaling, see Change auto scaling performance settings and Scaling elements

If you really want to put a hard limit on the number of instances you'll probably have to use basic scaling with a max_instances config or manual scaling.

这篇关于Google App Engine自动缩放如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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