rightsizer allows you to compute the appropriate size of your ECS services
based on the average resource usage in a given period of time. You can use the
output of the program to update your task definitions and keep your services on
the perfect size.
In order to use rightsizer you need to be logged in to your AWS Cli using
aws config files or a credential manager like our own
hologram. Then you invoque the rightsizer command using your
target cluster and service:
$ rightsizer some-cluster some-service
containerDefinitions:
some-database:
cpu: 1
memory: 500
memoryReservation: 95
some-nginx-thing:
cpu: 1
memory: 500
memoryReservation: 95
some-language-api:
cpu: 1
memory: 500
memoryReservation: 95The program will output the suggested configuration for your service based on your actual usage. Then you can use this output to patch your service or patch your deploy configuration.
The best way to get rightsizer is from dockerhub:
docker pull nextroll/rightsizerThen you can run the container with the following command:
docker run --rm nextroll/rightsizer rightsizer some-cluster some-serviceIf you want to build rightsizer from source you can use the following,
go build .This will generate a binary called rightsizer that you can use to run the
program.
We use gomock to generate mocks for our custom clients. If you update or create a new client, you need to regenerate the mocks. You can do this by running:
go generate ./...Then you can run the tests with the following command:
go test ./...