Web Servers - Do you get Zero Downtime when Updating a Server?
21/11/2017 11:23 AM by
If you are dealing with a single server, there is no way to achieve 100% uptime, when updating or restarting a server.
So set your website up correctly with at least 2 front ends, and 1 backend (the SQL Server).
Figure: Good Example – When one server goes down, the web site remains up
Then, use a Network Load Balancer (we recommend Microsoft’s build in NLB) which allows you to spread web site load to multiple servers, but even more helpful when you need to do Windows Updates or make changes to web servers in your environment.
Follow the below steps on your test server first, get the application tested passed, then move on to production.
- Open the Network Load Balancing Manager
- Right click on the machine you want to update | Select Control Host | Click Drain Stop Figure: The 2 green icons indicate both servers are live with users - Do a drain stop on the server you want to make changes too
- To view the current connections on the server, open a command prompt and enter netstat -an. You will be able to see the connections list dropping as users are sent to the other server Figure: Run "netstat -an" to view the current connections on the server
- Allow the NLB to finish sending the connections to the remaining servers. The server you have drain stopped, will turn red when all the users have been moved to the other server
Figure: When the server turns red, the connections have been dropped and you're ready to update
- Optional – if you are using Hyper-V, take a snapshot of the server you are about to make changes on
Figure: Now that the server isn't being hit with users, perform your updates. Click "Restart Now"
- Optional – Do a smoke test (open the site and check its working)
- Optional – Run any automated tests (for example Telerik Tests)
- When the server ready, add it back into the load balancer. Right click on the machine | Select Control Host | Click Start
- The server icon will return to green, and users will start being sent to the server again
Figure: The server will now accept connections again
- Follow the same process for the other server (or multiple)
Congratulations you've just updated your servers with 100% uptime.
Do you feel this rule needs an update?