What does setting the automatic_scaling max_idle_instances to zero (0) do?

谁说胖子不能爱 提交于 2019-12-20 05:24:15

问题


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?


回答1:


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:

Note: When settling back to normal levels after a load spike, the number of idle instances can temporarily exceed your specified maximum. However, you will not be charged for more instances than the maximum number you've specified.

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:

Because App Engine keeps idle instances in reserve, it is unlikely that requests will enter the pending queue except in exceptionally high load spikes. You will need to test your application and expected traffic volume to determine the ideal number of instances to keep in reserve.



来源:https://stackoverflow.com/questions/47482850/what-does-setting-the-automatic-scaling-max-idle-instances-to-zero-0-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!