Fargate Task Recycling

Posted on October 27, 2020

Came across something curious in my investigation into why I had a couple of Cloudwatch alarms going off.

Curious container restarts

Like clockwork, every six hours I was getting container restarts. I was absolutely perplexed, because our users had not reported any disruptions.

I started some mad searching and eventually found this article talking about it.

Summary notes:

  • The underlying managed infrastructure needs updates
  • AWS will do a rolling deploy of a new task instance and pull down the old one so that you’re always up to date

Just thought it was an interesting thing, took me a little longer than I like to admit searching for the symptoms “ECS container reboots every six hours”.