【发布时间】:2018-05-25 08:20:51
【问题描述】:
使用 AppEngine 的自动缩放器的新 rollout,为自动缩放配置添加了新的 configuration 选项,例如 min-instances 和 max-instances,表示可以,例如将最小实例数设置为 0 以降低成本:
<min-instances>可选。 App的最小实例数 为此模块版本创建的引擎。这些实例服务 请求到达时的流量,即使在 根据需要启动额外的实例来处理流量。
指定一个 0 到 1000 之间的值。您可以将参数设置为该值 0 允许在没有请求时扩展到 0 个实例以降低成本 被送达。请注意,您需要为实例数量付费 指定他们是否正在接收流量。
但是,对于 AppEngine 云 SDK 提供的 xsd 架构,只有 positive-integer 可以在 min-instances 或 max-instances 标签中设置:
<xs:complexType name="automatic-scaling-type">
<xs:all>
<xs:element type="xs:string" name="min-pending-latency" minOccurs="0"/>
<xs:element type="xs:string" name="max-pending-latency" minOccurs="0"/>
<xs:element type="xs:string" name="min-idle-instances" minOccurs="0"/>
<xs:element type="xs:string" name="max-idle-instances" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="min-instances" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="max-instances" minOccurs="0"/>
<xs:element type="xs:double" name="target-cpu-utilization" minOccurs="0"/>
<xs:element type="xs:double" name="target-throughput-utilization" minOccurs="0"/>
<xs:element type="xs:string" name="max-concurrent-requests" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="min-num-instances" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="max-num-instances" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="cool-down-period-sec" minOccurs="0"/>
<xs:element type="ns:cpu-utilization-type" name="cpu-utilization" minOccurs="0" xmlns:ns="http://appengine.google.com/ns/1.0"/>
<xs:element type="xs:positiveInteger" name="target-network-sent-bytes-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-network-sent-packets-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-network-received-bytes-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-network-received-packets-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-disk-write-bytes-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-disk-write-ops-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-disk-read-bytes-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-disk-read-ops-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-request-count-per-sec" minOccurs="0"/>
<xs:element type="xs:positiveInteger" name="target-concurrent-requests" minOccurs="0"/>
<xs:element type="ns:flex-custom-metrics-array" name="custom-metrics" minOccurs="0"/>
</xs:all>
</xs:complexType>
我同意将其设置为正整数对max-instances 有意义,但min-instances 呢?是文档中的错误还是印刷错误?
【问题讨论】: