简体   繁体   中英

ECS task definition - container per task or multiple container within task?

I searched the web for some practical information about task definitions and containers deployment but could not find any real life example.

Are there any situations where I would need to disperse my containers over multiple tasks instead of running multiple containers in 1 task?

For example, if I have one backend service and one frontend service, should I place both of them within the same task so they will share same network and be on the same host or should I create 2 separate tasks for them?

You can think of a task as the smallest unit in which ECS will scale. All containers in a task will be scheduled on the same host and can share information among each other. You'd put multiple containers in a single task if you want to implement patterns like sidecar, ambassador or adapter.

In your specific case, I'd separate the frontend and backend containers in their own tasks as they will probably benefit from being independently scalable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM