问题描述
将automatic_scaling max_idle_instances设置为零(0)是做什么的?
automatic_scaling:
max_idle_instances:0
min_idle_instances:0
是否会导致活动实例在完成处理后立即关闭当前请求?
从技术上讲,您甚至不能设置 max_idle_instances
它至 0
,您会在部署时发现此错误:
错误400:---开始服务器输出---
automatic_scaling.max_idle_instances(0),必须在[1,1000]范围内。
---结束服务器输出---
部署版本号低于已经部署的可能不会(立即)关闭已经运行超过新配置数量的空闲实例 - 该限制不是硬限制,在某些情况下可以超过限制。例如,从表格:
您还应该保留请记住,此配置适用于空闲实例,而不适用于动态/活动实例(这是处理大多数流量的实例)。降低 max_idle_instances
配置不会影响动态实例。
空闲实例仅用于瞬时溢出流量 - 请求目前正在运行的动态实例无法在传入流量突然上升的情况下处理可接受的延迟,而GAE则增加了额外的动态实例。
从上面引用的同一文档:
$ b
What does setting the automatic_scaling max_idle_instances to zero (0) do?
automatic_scaling:
max_idle_instances: 0
min_idle_instances: 0
Does it cause an active instance to shutdown immediately once it has finished processing it's current requests?
Technically you can't even set max_idle_instances
it to 0
, you'll see this error at deployment time:
Error 400: --- begin server output ---
automatic_scaling.max_idle_instances (0), must be in the range [1,1000].
--- end server output ---
Deploying a version with a lower number than the one already deployed might not (immediately) shut down idle instances already running that exceed the newly configured number - the limit is not a "hard" one, in some cases it can be exceeded. For example, from the automatic_scaling
row in the Scaling elements table:
You should also keep in mind that this config applies to the idle instances, not to the dynamic/active instances (which are the ones handling most of the traffic). Lowering the max_idle_instances
config won't affect the dynamic instances.
The idle instances only serve transient overflowing traffic - requests that the currently running dynamic instances can't handle with acceptable latency during sudden rises of the incoming traffic, while GAE spins up additional dynamic instances.
From the same doc referenced above:
这篇关于什么将automatic_scaling max_idle_instances设置为零(0)呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!