Recommendations for ECS service memory allocation based on CloudWatch Metrics.
npm install --global ecs-optimizer
$ ecs-optimizer --help
Usage: ecs-optimizer [options]
Options:
-V, --version output the version number
-r, --region [region] AWS region (required)
-c, --cluster [cluster] ECS cluster (required)
-p, --percentage [percentage] Target percentage memory utilization for services (default: 75)
-t, --type [type] Type of metric for utilization analyze (CPUUtilization or MemoryUtilization) (default: "MemoryUtilization")
-h, --help output usage information
$ ecs-optimizer --region us-east-1 --cluster my-ecs-cluster --percentage 75
Validating AWS credentials...
=> Logged in as arn:aws:sts::12345678910:assumed-role/role/nickname
Enumerating services in cluster: my-ecs-cluster...
=> Done.
Enumerating all available ECS utilization metrics...
=> Done.
Fetching statistics for active services...
=> Done.
Calculating maximum metric usage over last 24 hours...
=> Done.
Looking up task defintions for services...
=> Done.
Looking for improvements...
┌──────────────────────────┬──────────┬─────────┬──────────┐
│ Service │ Max Used │ Current │ Proposed │
├──────────────────────────┼──────────┼─────────┼──────────┤
│ service-a │ 59% │ 128 │ 112 │
├──────────────────────────┼──────────┼─────────┼──────────┤
│ service-b │ 77% │ 112 │ 112 │
├──────────────────────────┼──────────┼─────────┼──────────┤
│ service-c │ 22% │ 64 │ 32 │
├──────────────────────────┼──────────┼─────────┼──────────┤
│ service-d │ 38% │ 256 │ 144 │
├──────────────────────────┼──────────┼─────────┼──────────┤
│ service-e │ 82% │ 128 │ 144 │
└──────────────────────────┴──────────┴─────────┴──────────┘