在 Google 应用引擎中,只有一个实例处理大部分请求 [英] In Google app engine only one instance handling most of requests

查看:19
本文介绍了在 Google 应用引擎中,只有一个实例处理大部分请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在谷歌应用引擎中有 4 个实例,只有一个实例处理大部分请求.我们如何扩展以使所有实例都可以处理相同数量的请求?

We have 4 instances in google app engine and only one instance is handling most of the requests. How can we scale such that all the instances can handle equal number of requests?

推荐答案

在正在运行的实例之间均匀地平衡负载实际上并不意味着扩展.只要一个实例能够以可接受的性能处理传入请求,您就不会看到扩展问题.

Evenly balancing the load across the running instances doesn't actually mean scaling. As long as one instance is capable of handling the incoming requests with acceptable performance you're not looking at a scaling issue.

如果您使用自动或基本扩展(如果您关心可扩展性,则应该这样做),在运行的实例之间分布的不均匀负载实际上对于控制自动实例必不可少- 需求启动(当负载超过某个阈值时)和关闭(当实例空闲时).

If you're using automatic or basic scaling (which you should, if you're concerned with scalability) the uneven load spread across the running instances can actually be essential for controlling the automatic instance on-demand spinup (when load exceeds a certain threshold) and shutdown (when instances are idling).

例如,如果可以由 1-2 个实例轻松处理的负载将均匀分布在 4 个正在运行的实例上,那么 4 个实例中没有一个会空闲足够长的时间来关闭.

For example if a load that could be easily handled by 1-2 instances would be evenly distributed across 4 running instances then none of the 4 instances would be idle long enough to be shut down.

将单个实例作为运行流量的首选"实例,而其他实例只是选择操作溢出"/峰值负载,这使得控制实例启动/关闭的算法变得更加简单(我认为 更精确) - 阈值比较逻辑只需要应用于一个(或几个)正在运行的实例,而不是所有实例.

Having a single instance as the "preferred" one to run traffic on and the others just picking op "overflowing"/peak load makes the algorithm for controlling instance spinup/shutdown a lot simpler (and I think more precise as well) - the threshold comparison logic only needs to be applied on one (or just a few) running instances, not on all of them.

这篇关于在 Google 应用引擎中,只有一个实例处理大部分请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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