8 months ago
When a new deployment goes live, how does Railway determine when it's safe to remove the previous deployment?
If I have in-flight requests being handled on the previous deployment, is there any way to ensure those conclude safely before the instance closes? Maybe some sort of overlap period (during which both deploys are active), where all new requests get directed to the new deploy, but the previous deploy has time to wrap up?
5 Replies
8 months ago
You can set the time from when a new deployment becomes Active until the previous deployment is removed can be controlled by setting a RAILWAY_DEPLOYMENT_OVERLAP_SECONDSservice variable.
Docs page: https://docs.railway.com/reference/deployments
As for confirming when it's safe, we have healthchecks for that reason but there is no way to know when in-flight requests complete. Usually we advocate users to have some sort of job or queue system to keep async workflows in progress.
Hope this helps!
- Angelo
Status changed to Awaiting User Response Railway • 8 months ago
angelo-railway
You can set the time from when a new deployment becomes Active until the previous deployment is removed can be controlled by setting a RAILWAY_DEPLOYMENT_OVERLAP_SECONDSservice variable.Docs page: https://docs.railway.com/reference/deploymentsAs for confirming when it's safe, we have healthchecks for that reason but there is no way to know when in-flight requests complete. Usually we advocate users to have some sort of job or queue system to keep async workflows in progress. Hope this helps!- Angelo
8 months ago
Perfect - thanks! And during the overlap period, all inbound traffic will be sent to the new deploy?
Status changed to Awaiting Railway Response Railway • 8 months ago
8 months ago
Yes. Essentially, you are letting the old server process the existing requests.
Status changed to Awaiting User Response Railway • 8 months ago
Status changed to Awaiting Railway Response Railway • 8 months ago
Status changed to Awaiting User Response Railway • 8 months ago
Status changed to Solved angelo-railway • 8 months ago