Q
Get started Bring yourself up to speed with our introductory content.

How can we save money in Amazon EC2 Container Service?

Our group doesn't need containers all the time. How can we scale back or stop a Docker container that's running in Amazon Elastic Container Service?

Container-based virtualization eliminates the need for separate operating systems in each VM -- saving money on...

licensing costs, boosting performance and improving efficiency. Amazon EC2 Container Service offers hosted, managed and fully programmable APIs to run Docker containers from within EC2. But cloud administrators must manage cloud deployments to reduce or eliminate unused resources.

Each time a VM or container is provisioned to a cloud service such as Amazon EC2 Container Service (ECS), the associated computing resources incur costs. And as long as those resources are allocated to the instance, those costs recur monthly. And while it's easy to set up and use an Amazon ECS cluster to experiment or test applications, it's vital to clean up those resources when you're done -- or pay the price.

There are three ways to free up resources in Amazon ECS: scaling, deregistering and deleting. To start, scale down inactive services; this reduces or eliminates tasks associated with an unnecessary service. By preventing Amazon ECS from starting unnecessary or unproductive new tasks for that service, admins can free up resources for other operations.

Next, deregister unneeded container instances to stop any tasks that are running on the deregistered container. This also prevents the container from starting new tasks. If you plan to eventually delete a cluster, you'll need to deregister all of the container instances inside that cluster. While deregistering removes the container from your cluster, administrators must explicitly terminate the instance to cease billing.

Administrators also can delete services, clusters and even the AWS CloudFormation stack as needed to reduce billing costs and unneeded resources. For example, administrators can delete services within a cluster. Once there are no longer any tasks running in the service, administrators can use the Amazon ECS console to remove the service and free resources.

After the active services within a cluster have been scaled down and deleted, admins can delete the cluster. The ultimate cleanup process is to delete the AWS CloudFormation stack, which then deletes EC2 instances, removes Auto Scaling, deletes any virtual private cloud subnet or Internet gateway allocated to the cluster, and removes any elastic load balancing implementation.

Administrators can perform these operations through the Amazon ECS Management Console or the AWS command-line interface using structured command. Advanced resources, such as EC2 instance management, load balancing and Auto Scaling group management, must be handled through the EC2 Management Console or by deleting the associated AWS CloudFormation stack through the AWS CloudFormation console.

Next Steps

Benefits of using Amazon EC2 Container Service with Docker

Deploy server clusters with AWS EC2 Container Service

Docker on AWS: It's not you, it's me

Learn how Amazon ECS helps organizations run containers

This was last published in June 2015

Dig Deeper on AWS instances strategy and setup

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What is your company's approach to containerization?
Cancel

-ADS BY GOOGLE

SearchCloudApplications

TheServerSide.com

SearchSoftwareQuality

SearchCloudComputing

Close