Task Definition size according to Docker image size

0

Greetings,

I have a Docker image with size ~8GB. When creating a Task Definition I am prompted to fill the Task size (CPU and Memory) and optionally the Container size (CPU and Memory). Even though I've read the info sections it does not come clear to me the difference between the two.

Should I set the size of the Container and the Task to 8 GB? In case the both sizes are less than the image size the container would not run?

apssg
已提问 1 年前618 查看次数
1 回答
1
已接受的回答

The size of the docker image you're referring to seems to be the file size, which wouldn't be impacted by memory limitations. The term memory refers to the component within your computer that allows for short-term data access and is typically used in computing to store working data for a system[1]. [1] https://en.wikipedia.org/wiki/Random-access_memory

When you have a file and save it in a file system it isn't normally stored in memory unless it's been recently accessed, and memory is able to cycle out old cached content as new content is requested[2]. [2] https://www.oreilly.com/library/view/understanding-the-linux/0596002130/ch14s02.html

Now onto the differences between task size and container size. When you register a task definition, you can specify the total CPU and memory used for the task. This is separate from the cpu and memory values at the container definition level. A single ECS task may have many containers running to complete, and in these cases the "Container Size" parameter would limit each container's resource consumption, while the "Task Size" parameter would limit how many total resources your Task may use[3]. [3] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

In regards to performance issues or launch failures, unless you load too much into RAM at once your task should still run fine, even with your image file being 8 GB. Something good to note though, Task-level CPU and memory parameters are ignored for Windows containers. We recommend specifying container-level resources for Windows containers.

AWS
byod
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则