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年前619ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ