查询端点自动缩放历史记录 - Amazon SageMaker
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

查询端点自动缩放历史记录

您可以使用终端节点查看扩展活动的状态,DescribeScalingActivitiesDescribeScalingActivities提供了有关前六周在指定命名空间中扩展活动的描述性信息。

如何查询终端自动缩放操作

查询您的自动缩放终端节点DescribeScalingActivities。为此,请指定ServiceNameSpace参数。ServiceNameSpace是Amazon提供资源的服务。

有效的服务名称值包括:

ecs | elasticmapreduce | ec2 | appstream | dynamodb | rds | sagemaker | custom-resource | comprehend | lambda | cassandra

在这种情况下,您需要设置ServiceNameSpacesagemaker

请使用以下:Amazon CLI命令查看有关所有sagemaker具有扩展策略的终端节点:

aws application-autoscaling describe-scaling-activities \ --service-namespace sagemaker

您可以使用搜索特定端点ResourceId

aws application-autoscaling describe-scaling-activities \ --service-namespace sagemaker \ --resource-id endpoint/<endpoint_name>/variant/<variant_name>

运行此命令时,它将返回以下输出:

{ "ActivityId": "activity-id", "ServiceNamespace": "sagemaker", "ResourceId": "endpoint/<endpoint_name>/variant/<variant_name>", "ScalableDimension": "sagemaker:variant:DesiredInstanceCount", "Description": "string", "Cause": "string", "StartTime": timestamp, "EndTime": timestamp, "StatusCode": "string", "StatusMessage": "string" }

如何识别由于实例配额而阻止的 AutoScaling

当您向外扩展或添加更多实例时,您可能会达到您的账户级实例配额。您可以使用DescribeScalingActivities来检查您是否已达到实例配额。当您超出配额时,自动扩展将被阻止。

要检查您是否已达到实例配额,请使用Amazon CLI命令,如以下示例中所示,您在其中指定了ResourceId

aws application-autoscaling describe-scaling-activities \ --service-namespace sagemaker \ --resource-id endpoint/<endpoint_name>/variant/<variant_name>

在返回语法中,检查StatusCodeStatusMessage键及其关联值。StatusCode返回Failed。WITHYStatusMessage会显示一条消息,指示已达到帐户级别的服务配额。以下是该消息具体形式的示例:

{ "ActivityId": "activity-id", "ServiceNamespace": "sagemaker", "ResourceId": "endpoint/<endpoint_name>/variant/<variant_name>", "ScalableDimension": "sagemaker:variant:DesiredInstanceCount", "Description": "string", "Cause": "minimum capacity was set to 110", "StartTime": timestamp, "EndTime": timestamp, "StatusCode": "Failed", "StatusMessage": "Failed to set desired instance count to 110. Reason: The account-level service limit 'ml.xx.xxxxxx for endpoint usage' is 1000 Instances, with current utilization of 997 Instances and a request delta of 20 Instances. Please contact Amazon support to request an increase for this limit. (Service: AmazonSageMaker; Status Code: 400; Error Code: ResourceLimitExceeded; Request ID: request-id)." }