Reputation: 11207
With a stateless web app such as a Rails running on Unicorn, instructions for doing a zero downtime upgrade is easy to Google for.
But what is the best practice for upgrading a nodejs web app that has websocket connections? How can those websocket connections be carried over without disruption?
Upvotes: 2
Views: 691
Reputation: 1030
Deploy your new code on a different port, then forward the original port to this new instance. The old connections will still be connected to your old application untill their session ends, and all new connections will be made with the new instance.
When you are satisfied that all users are on the new code base, you can shut down the old process.
Upvotes: 3