added rack param ecs_container_stop_timeout #3744
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the feature/update/fix?
Feature: Configurable ECS Container Stop Timeout
We have added a new rack parameter,
EcsContainerStopTimeout
, that allows you to configure the default timeout (in seconds) after which a container is forcibly stopped by sending a SIGTERM signal. By setting this parameter, you can adjust the stop timeout for ECS containers, which can be useful for managing graceful shutdowns under specific load conditions.How to use it?
To set the
EcsContainerStopTimeout
parameter, use the following command:For example, to set a timeout of 1 minuet:
This configuration will allow containers more time to complete their processes before being stopped, helping to manage high-traffic shutdowns smoothly.
Use Cases
Graceful Shutdowns: If your application is handling a high volume of requests, a longer stop timeout can allow for a more graceful shutdown, ensuring that current requests are completed without interruption and avoiding spikes in CPU load from a sudden container termination.
Session Persistence: For applications with session-based connections (e.g., WebSocket servers or databases), extending the container stop timeout can allow existing sessions to close gracefully, reducing potential disruptions for users.
Managing Large Batch Jobs: If your containers are processing batch jobs or long-running tasks, setting a higher stop timeout can prevent task interruptions and help complete ongoing processes.
Why is this important?
This parameter provides greater flexibility in managing ECS container lifecycles, which is essential for applications that handle high traffic or resource-intensive tasks. Adjusting the stop timeout can help improve user experience by enabling graceful shutdowns and minimizing CPU spikes or other disruptions when containers are terminated.
Does it have a breaking change?
There are no breaking changes introduced with this feature.
Requirements
To use this feature, you must be on at least rack version
latest
.You can check your rack's version with the command
convox rack -r rackName
.Update your rack to the latest version with the command
convox rack update -r rackName
.