Maxim_Kazmin - Fotolia

How do I schedule tasks in Amazon EC2 Container Service?

Our enterprise started using Amazon ECS to run instances within containers. How can developers create and schedule tasks in the service?

Amazon Elastic Container Service is based on the notion of a container instance -- essentially an Amazon Elastic...

Compute Cloud entity running an ECS agent. This agent helps create and manage Linux-based containers. Developers can organize container instances into clusters for scalability and redundancy.

To get the full benefits of Amazon EC2 Container Service (ECS), it's important to understand a variety of terms and how each term relates to others. Amazon ECS defines containers through a task definition, which describes application components, settings and other attributes. When the task runs, the application launches into a container instance. Amazon places and manages tasks on container instances using a scheduler. All of the scheduled tasks that run are referred to as the container service, or simply the service.

To create a Linux-based Docker container on the service, developers must first define a task -- typically by using the Amazon ECS console or scripted using the AWS command-line interface (CLI). As a rule, the task definition comprises a wide range of parameters, including the base Docker image to be deployed, processor and memory allocation, any environment variables passed to the container, the task disposition (if the container finishes or ceases to function), port access, linked containers and any data volumes or other storage resources used with the container.

After creating a task, developers must schedule it. Amazon ECS schedulers can run batch or single-run tasks directly and also launch ongoing or long-term applications. The scheduler places containers automatically depending on resource availability and load conditions across the cluster -- direct commands also allow IT teams to place tasks in specific instances as desired. The scheduler can restart failed tasks automatically and perform automatic load balancing. ECS supports third-party or open source schedulers, so organizations can use AWS APIs, software development kits and the CLI to formulate direct task control.

By default, Amazon ECS supports up to 1,000 tasks per service. Each task definition can involve up to 10 containers; the definition itself can be up to 32 KB long. To suit new computing needs, users can throttle the number of container instances per second for each single-run task as well as the registration rates for container instances and task definitions.

Next Steps

How secure is Amazon's container service?

Three ways to free up resources in Amazon ECS

How can we save money in Amazon EC2 Container Service?

Dig Deeper on AWS instances strategy and setup