Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added rack param ecs_container_stop_timeout #3744

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

numcys
Copy link
Contributor

@numcys numcys commented Oct 29, 2024

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:

$ convox rack params set EcsContainerStopTimeout <#in min> -r rackName

For example, to set a timeout of 1 minuet:

$ convox rack params set EcsContainerStopTimeout 1m -r rackName

This configuration will allow containers more time to complete their processes before being stopped, helping to manage high-traffic shutdowns smoothly.

Use Cases

  1. 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.

  2. 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.

  3. 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.

@numcys numcys requested a review from nightfury1204 October 29, 2024 15:20
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.17%. Comparing base (01a2ab5) to head (7b9b32a).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3744      +/-   ##
==========================================
- Coverage   33.56%   33.17%   -0.39%     
==========================================
  Files         180      182       +2     
  Lines       20253    20540     +287     
==========================================
+ Hits         6797     6814      +17     
- Misses      12309    12578     +269     
- Partials     1147     1148       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nightfury1204 nightfury1204 merged commit 908e58a into master Oct 31, 2024
4 checks passed
@nightfury1204 nightfury1204 deleted the param-add/ecs-container-stop-timeout branch October 31, 2024 14:08
@nightfury1204 nightfury1204 restored the param-add/ecs-container-stop-timeout branch October 31, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants