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

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

问题描述

我们在Google应用引擎中有4个实例,只有一个实例处理大部分请求。我们如何扩展以使所有的实例可以处理相同数量的请求?解析方案

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



如果您使用自动或基本缩放(如果您担心可伸缩性,那么负载均匀分布在正在运行的实例中可能实际上是必不可少的,用于控制自动实例按需启动(当负载超过特定阈值时)并关闭(当实例空闲时)。例如,如果一个容易被1-2个实例处理的负载将在4个正在运行的实例中平均分配,那么这4个实例中的任何一个都不会闲置足够长的时间



将单个实例作为首选的实例来运行流量,而其他实例只是选择操作溢出/峰值负载使得控制算法实例spinup / shutdown更简单很多(我也认为它更精确) - 阈值比较逻辑只需要应用于一个(或少数几个)正在运行的实例,而不是全部运行实例。

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).

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天全站免登陆