1
votes

I have an ECS cluster set up. I can launch several tasks that all point to the same task definition, and I see them running with different container runtime id.

I understand that Each Fargate task has its own isolation boundary and does not share the underlying kernel, CPU resources, memory resources, or elastic network interface with another task.

What I want to understand is does each task gets its own disk space as well? Suppose I append logs to a static file (logs/application_logs.txt). Will each running task only have its own logs in that file?

If 3 tasks are running together, will the logs of all 3 tasks end up in logs/application_logs.txt?

2

2 Answers

1
votes

What I want to understand is does each task gets its own disk space as well? Suppose I append logs to a static file (logs/application_logs.txt). Will each running task only have its own logs in that file?

Each fargate task gets its own storage space allocated. This is unique to the task. Each running task will only have its own logs in that particular location.

If 3 tasks are running together, will the logs of all 3 tasks end up in >logs/application_logs.txt?

No they will not. You can add data volumes to tasks that can be shared between multiple tasks if you wanted to. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html for more info.

1
votes

Quoting the doc:

When provisioned, each Fargate task receives the following storage. Task storage is ephemeral. After a Fargate task stops, the storage is deleted.

  • 10 GB of Docker layer storage
  • An additional 4 GB for volume mounts. This can be mounted and shared among containers using the volumes, mountPoints and volumesFrom parameters in the task definition.

Yes, if you have provisioned storage inside volumes section of task definition then your task gets a non-persistent storage.

If you're appending logs to a file and there are 3 tasks running then I guess each one of them will have their own log file.