Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
How does ECS Fargate auto scaling policy know not to kill a working task?

I have an ECS Fargate cluster with a service that generates tasks based on how many messages are in a queue. Each task does long polling on the queue and processes one message at a time. If the queue gets over 5 messages a new task is spun up and it starts taking messages. When the queue then drops below 5 messages from the previous threshold, it shuts down a task.

My question is, when the service decides to scale down, how does it know what task to kill? All tasks could be processing a message. Each task continuously runs and does long pulling from SQS, so how would it know that a task is in valid shut down state (just completed a message) and a non-valid shut down state (currently processing a message).

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is an open issue for improving termination of tasks as people have same concerns as you:

  • [ECS] [request]: Control which containers are terminated on scale in #125

From the issue, you can minimize the impact of termination of tasks on your processes by using stopTimeout. The parameter is:

Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.

But there is also a new feature for ESC:

  • Amazon ECS Introduces Enhanced Container Dependency Management

With this you can setup:

dependencies for container startup and shutdown as well as a per-container start and stop timeout value.

So generally there is no full control over termination of tasks, like you have in termination of instances in AutoScaling Group. But the things are getting worked on.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!