I'm currently running some containers on production using AWS Fargate
. I'm running an application that from time to time populates some files to /tmp
folder.
That said, I want to know what happens to this /tmp
folder. Is this something managed by Fargate
(by ECS Container Agent, for example) or is it something that I need to manage by myself (using a cronjob
to clear the files there, for example)?
NOTE 1: One way to handle that is to use s3
to handle that kind of behavior, however, the question is to know how Fargate
behaves regarding /tmp
folder.
NOTE 2: I don't need the files in /tmp
folder, they just happen to appear there, and I want to know if I need to remove them or if ECS
will do that for me.
I couldn't find anything about that in documentation. If someone points that subjects on the docs, I would be happy to accept the answer.
AWS Fargate is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances. With Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers.
Since Fargate is a serverless compute engine, customers do not need to manage the underlying compute instances running in Fargate. Therefore, Fargate will manage the Windows OS licenses for you and the cost of doing so is built into the Fargate pricing.
You can increase or decrease your desired task count by integrating Amazon ECS on Fargate with Amazon CloudWatch alarms and Application Auto Scaling.
AWS Fargate capacity providersAmazon ECS cluster capacity providers enable you to use both Fargate and Fargate Spot capacity with your Amazon ECS tasks. With Fargate Spot you can run interruption tolerant Amazon ECS tasks at a discounted rate compared to the Fargate price.
if I understand your question correctly, it looks like you want more precise control over temporary storage within your container.
I don't think there is anything special that ECS or Fagate does with /tmp folders on the FS within the container.
However, docker does have a notion of a tempfs mount. This allows you to designate a path that allows you to avoid storing data on the containers host machine.
https://docs.docker.com/storage/tmpfs/
ECS and Fargate recently added support for the tmpfs flag:
https://aws.amazon.com/about-aws/whats-new/2018/03/amazon-ecs-adds-support-for-shm-size-and-tmpfs-parameters/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With