a year ago
When a new instance is deployed, are the requests being processed on the previous instance canceled or are they waited for to complete?
4 Replies
a year ago
Hello,
By default, when a new deployment goes into the ACTIVE state we will send SIGTERM to the old container, wait 3 seconds for it to gracefully shut down, and if it hasn't shut itself down after the 3 seconds, we force kill it.
You can control that SIGTERM to SIGKILL time with a RAILWAY_DEPLOYMENT_DRAINING_SECONDS variable -
https://docs.railway.com/reference/deployments#singleton-deploys
So once you extend that time frame, any new incoming requests HTTP requests would be routed to the new deployment, while we wait for the old deployment to either gracefully shut down, or for whatever time you have set until we kill it.
Hope this helps!
Best,
Brody
Status changed to Awaiting User Response Railway • 11 months ago
brody
Hello,By default, when a new deployment goes into the ACTIVE state we will send SIGTERM to the old container, wait 3 seconds for it to gracefully shut down, and if it hasn't shut itself down after the 3 seconds, we force kill it.You can control that SIGTERM to SIGKILL time with a RAILWAY_DEPLOYMENT_DRAINING_SECONDS variable -https://docs.railway.com/reference/deployments#singleton-deploysSo once you extend that time frame, any new incoming requests HTTP requests would be routed to the new deployment, while we wait for the old deployment to either gracefully shut down, or for whatever time you have set until we kill it.Hope this helps!Best,Brody
a year ago
Ok, thanks. And if I change RAILWAY_DEPLOYMENT_DRAINING_SECONDS to 600 seconds, for example, that means that if the SIGTERM signal does not stop the container, we wait 10 minutes before forcing the container to stop. Is that correct?
And do all new requests that arrive in the 10-minute interval go to the old or new deployment?
Status changed to Awaiting Railway Response Railway • 11 months ago
kevinrss01
Ok, thanks. And if I change RAILWAY_DEPLOYMENT_DRAINING_SECONDS to 600 seconds, for example, that means that if the SIGTERM signal does not stop the container, we wait 10 minutes before forcing the container to stop. Is that correct?And do all new requests that arrive in the 10-minute interval go to the old or new deployment?
a year ago
Correct. New deployment.
Status changed to Awaiting User Response Railway • 11 months ago
unicodeveloper
Correct. New deployment.
a year ago
Thank you 
Status changed to Awaiting Railway Response Railway • 11 months ago
Status changed to Solved unicodeveloper • 11 months ago