暂时关闭扩展策略 - Amazon SageMaker AI
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

暂时关闭扩展策略

配置自动扩缩后,如果您需要在不受扩展策略干扰的情况下调查问题(动态扩展),可以使用以下选项:

  • 调用 register-scalable-target CLI 命令或 RegisterScalableTarget API 操作,为 DynamicScalingInSuspendedDynamicScalingOutSuspended 指定一个布尔值,即可暂时中止然后恢复扩展活动。

    下面的示例显示了如何暂停在 my-endpoint 端点上运行的名为 my-variant 的变体的扩展策略。

    aws application-autoscaling register-scalable-target \ --service-namespace sagemaker \ --resource-id endpoint/my-endpoint/variant/my-variant \ --scalable-dimension sagemaker:variant:DesiredInstanceCount \ --suspended-state '{"DynamicScalingInSuspended":true,"DynamicScalingOutSuspended":true}'
  • 通过禁用策略的横向缩减部分,防止特定目标跟踪扩展策略在变量中横向缩减。这种方法可以防止扩展策略删除实例,但仍允许它根据需要创建实例。

    使用 put-scaling-policy CLI 命令或 PutScalingPolicy API 操作,指定 DisableScaleIn 的布尔值,即可暂时禁用然后启用扩展活动。

    下面是扩展策略目标跟踪配置的示例,该策略将横向扩展,但不会横向缩减。

    { "TargetValue": 70.0, "PredefinedMetricSpecification": { "PredefinedMetricType": "SageMakerVariantInvocationsPerInstance" }, "DisableScaleIn": true }