Last active
June 15, 2023 12:52
-
-
Save saswata-dutta/15c06f5e764034da9a0ee74e86c34893 to your computer and use it in GitHub Desktop.
sagemaker auto scaling scaling; https://docs.aws.amazon.com/sagemaker/latest/dg/endpoint-auto-scaling-add-code-define.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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