Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between REPLICA and DAEMON service type in Amazon EC2 Container Service?

Tags:

When I created service in Amazon EC2 Container Service, there were 2 options for service type: REPLICA and DAEMON.

What is the exact difference between them?

Replica services place and maintain a desired number of tasks across your cluster. Daemon services place and maintain one copy of your task for each container instance

enter image description here

like image 551
transang Avatar asked Jun 27 '18 04:06

transang


People also ask

What is daemon in AWS?

The AWS X-Ray daemon is a software application that listens for traffic on UDP port 2000, gathers raw segment data, and relays it to the AWS X-Ray API. The daemon works in conjunction with the AWS X-Ray SDKs and must be running so that data sent by the SDKs can reach the X-Ray service.

What is a service in ECS cluster?

Amazon ECS allows you to run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster. This is called a service.

What is the difference between EC2 and container?

AWS Elastic Compute Cloud (EC2) is a web-based service. It provides scalable computing power on AWS, whereas AWS Elastic Container Service (ECS) is a container orchestration service. To explain ECS vs EC2 briefly, Amazon ECS is a good way to run containers inside Amazon EC2 instances.

What is Amazon EC2 Container Service?

Amazon EC2 Container Service is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run distributed applications on a managed cluster of Amazon EC2 instances.


1 Answers

Your ECS cluster most likely exists out of multiple EC2 instances (= Container instances).

According to the AWS documentation

Replica: The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions

Daemon: The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. When using this strategy, there is no need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.

This means that, if you have an ECS cluster with three EC2 instances and you want to launch a new service with four tasks, the following will happen:

  • Replica: Your four tasks will start randomly distributed over your container instances. This can be all four on one instance or any other random distribution. This is the use case for normal micro services.

  • Daemon: For a daemon you do not specify how many tasks you want to run. A daemon service automatically scales depending on the amount of EC2 instances you have. In this case, three. A daemon task is a pattern used when building microservices where a task is deployed onto each instance in a cluster to provide common supporting functionality like logging, monitoring, or backups for the tasks running your application code.

like image 96
ThomasVdBerge Avatar answered Sep 25 '22 15:09

ThomasVdBerge