AWS ECS
Learn how Sedai autonomously optimizes AWS ECS clusters for performance and cost.
Sedai intelligently optimizes your ECS clusters at both task and container levels. The following optimization features are available for both Fargate and EC2-based clusters:
- Cost optimization: Sedai autonomously optimizes ECS clusters and services to improve both cost and resource efficiency. This is achieved by:
- Right sizing ECS services: Sedai determines the optimal CPU and memory at the service-level and then allocates based on actual usage in production environments to prevent excessive cost.
- Optimizing ECS cluster configurations: Sedai optimizes cluster CPU & memory configurations for both Fargate and EC2-based clusters to improve performance, scalability, and overall efficiency.
- Using optimized purchasing options from cloud providers: Sedai uses cloud provider purchasing options to optimize ECS clusters for performance and cost.
- Performance Optimization: In addition to optimizing cost, Sedai autonomously improves application performance. Sedai’s intelligent and continuous horizontal and vertical right sizing increases performance efficiency, allows for greater scalability, and ultimately improves overall reliability.
- Autonomous ECS Auto Scaling Configurations: Sedai auto-selects and updates the best scaling policies for Amazon ECS Service Auto Scaling to ensure your ECS clusters run as efficiently as possible.
Automatic scaling is the ability to increase or decrease the desired count of tasks in your Amazon ECS service automatically. Amazon ECS leverages the Application Auto Scaling service to provide this functionality.
Service auto scaling - Amazon Elastic Container Service
Amazon Elastic Container Service
View AWS Documentation for additional details
Service Auto Scaling is made possible by a combination of the Amazon ECS, CloudWatch, and Application Auto Scaling APIs. Services are created and updated with Amazon ECS, alarms are created with CloudWatch, and scaling policies are created with Application Auto Scaling.
In order to utilize autonomous service Auto Scaling, you will need to complete the following steps:
- 1.Create an IAM Role for ECS Auto Scaling within AWS Console
- 2.Provide the Role ARN to Sedai from the account Integration page
To allow Sedai to autonomously manage and tweak the ECS Auto Scaling features, you need to provide an IAM Role ARN with sufficient privileges.
The IAM Role for Auto Scaling differs from the one used to connect your AWS account to Sedai during initial onboarding because it includes different IAM permissions. You can view a copy of the permissions for the integration IAM Role used to connect to Sedai here.
If you have an existing IAM Role used for configuring Auto Scaling, you can use its Role ARN to grant Sedai permission to enable autonomous ECS Auto Scaling, or create a new IAM Role using the CloudFormation template below:
Step 1 — Click here to launch Sedai's CloudFormation Stack in your AWS Console, or view the raw version of the template here
Step 2 — Use the following CloudFormation S3 URL:
https://sedai-onboarding-templates-prod.s3.amazonaws.com/sedai-integration-ecs-cluster-autoscaling-role.yml
- The CloudFormation Stack will automatically set up the following:
- 1.IAM Role for Application Auto Scaling (called
SedaiIntegrationAppAutoScalingRole
) - 2.IAM Policy Statement for enabling Application Auto Scaling (called
SedaiIntegrationAppAutoScalingPolicy
). View a summary of the policy details below, or download a copy of the policy:
- Effect: Allow
Action:
- "application-autoscaling:*"
- "ecs:DescribeServices"
- "ecs:UpdateService"
- "cloudwatch:DescribeAlarms"
- "cloudwatch:PutMetricAlarm"
- "cloudwatch:DeleteAlarms"
- "cloudwatch:DescribeAlarmHistory"
- "cloudwatch:DescribeAlarmsForMetric"
- "cloudwatch:GetMetricStatistics"
- "cloudwatch:ListMetrics"
- "cloudwatch:DisableAlarmActions"
- "cloudwatch:EnableAlarmActions"
- "iam:CreateServiceLinkedRole"
- "sns:CreateTopic"
- "sns:Subscribe"
- "sns:Get*"
- "sns:List*"
Resource: "*"
Step 3 — Once the role and policy is generated, you will need to copy the Role ARN (this can be found from the Outputs tab of the CloudFormation stack).
Once you have successfully generated the Role ARN, navigate to the Settings > Integrations within Sedai. Select the nickname for the AWS account that you previously added to Sedai, or connect a new AWS account.
From within the Integrations Account page, go to the Auto Scaling Configuration section and paste in the Role ARN; click Save to apply.
Now that Sedai has permission and access to make changes regarding autoscaler configurations in your AWS account, you next need to enable the feature from Settings > Topology. From this page, select the same AWS account.
- To enable the Auto Scaling Configuration feature for the account: Select the Default Settings Edit button and select Optimization, then choose the ECS tab. Under the Actions section at the bottom, toggle Autoscaler Configuration On.
- To enable the Auto Scaling Configuration feature for a specific resource: Search and select for your resource; from the side drawer, select Optimization. Under the Actions section at the bottom, toggle Autoscaler Configuration On.
Based on the Optimization setting defined at the top of the side drawer, Sedai will either autonomously configure Auto Scaling, or generate a configuration recommendation. You can view a history of autonomous Auto Scaling Configuration changes from the Activity > Timeline page, or any active config recommendations for Auto Scaling from the Activity > Tasks page.
Last modified 7mo ago