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
질문됨 일 년 전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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠