When elastic load balancing (ELB) is associated with an auto-scaling group, you can specify a grace period during which new EC2 instances will not be terminated, even if they are marked as unhealthy ELBs. Is it possible to indicate a similar grace period during which new ECS tasks will not be killed and restarted by their associated ECS, even if the ECS instance on which the task is executed has been marked with an unhealthy ELB?
Update:
In our current use case, the docker container, running as an ECS task, contains a JBoss instance that loads multiple caches at startup. These caches can take several minutes. However, ECS registers the container instance with the ELB as soon as the container starts. This means that traffic can be redirected to a new container before it is ready to accept it. We could extend the health check interval and healthy / unhealthy thresholds on the ELB so that the ELB does not spend traffic on the instance and ECS from restarting the container to loading the caches. However, increasing the health check interval and thresholds is undesirable, because if the instance is marked as unhealthy after loading the caches,ECS should restart the container as soon as possible (which requires a shorter health check interval and lower thresholds).
Thus, is it possible to apply a grace period during which traffic will not be redirected to a new container using ELB, and ECS will not restart the container (even if it did not pass the health check)? Or, if it is not, are there any suggestions for a solution for our use case?
source
share