8

I'm running a task at fargate with CPU as 2048 and memory as 8192. Task after running some time is stopped with error

container was stopped as it ran out of memory.

Thing is that task does not fails every time. If I run the same task 10 time it fails 5 times and works 5 times. However If I take an ec2 machine with 2 vcpu and 4GB memory and try to run the same container it runs successfully.(Infact the memory usage on ec2 instance is very low). Can somebody please guide me how to figure out the memory issue while running a fargate task?

Thanks

ajay singh
  • 135
  • 1
  • 7
  • I'm encountering the same error. Fargate task keeps crashing due to Out of Memory but I've tested the app and it does not consume much memory. Following this thread. – Ninz Oct 25 '20 at 17:34

1 Answers1

0

The way to start would be enabling memory metrics from container insights for your fargate tasks and Further correlating the Memory Usage graph with Application logs. help here

The difference between running on EC2 vs Fargate could probably be due to the fact that when you run a container on ECS Fargate, it runs on AWS's internal EC2 Instances. Now, here could possibly arise a Noisy Neighbour Situation although the chances would be pretty low.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Kashish Soni
  • 161
  • 4