Skip to content

Instantly share code, notes, and snippets.

@saswata-dutta
Last active June 15, 2023 12:52
Show Gist options
  • Save saswata-dutta/15c06f5e764034da9a0ee74e86c34893 to your computer and use it in GitHub Desktop.
Save saswata-dutta/15c06f5e764034da9a0ee74e86c34893 to your computer and use it in GitHub Desktop.
aws application-autoscaling register-scalable-target --region REGION \
--service-namespace sagemaker \
--resource-id endpoint/ENDPOINT_NAME/variant/VARIANT_NAME \
--scalable-dimension sagemaker:variant:DesiredInstanceCount \
--min-capacity MIN_VALUE \
--max-capacity MAX_VALUE
target_tracking_json='{"TargetValue": SCALING_VALUE, "PredefinedMetricSpecification": {"PredefinedMetricType": "SageMakerVariantInvocationsPerInstance"}}'
echo $target_tracking_json > target_tracking_scaling_policy.json
aws application-autoscaling put-scaling-policy --region REGION \
--policy-name SageMakerEndpointInvocationScalingPolicy \
--service-namespace sagemaker \
--resource-id endpoint/ENDPOINT_NAME/variant/VARIANT_NAME \
--scalable-dimension sagemaker:variant:DesiredInstanceCount \
--policy-type TargetTrackingScaling \
--target-tracking-scaling-policy-configuration file://target_tracking_scaling_policy.json
aws application-autoscaling describe-scaling-policyies --service-namespace sagemaker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment