Home
Web Servers - Do you get Zero Downtime when Updating a Server?
  v3.0 Posted at 21/11/2017 11:23 AM by Tiago Araujo

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

Server down, site up 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.

  1. Open the Network Load Balancing Manager
  2. Right click on the machine you want to update | Select Control Host | Click Drain Stop 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
  3. 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 netstat Figure: Run "netstat -an" to view the current connections on the server
  4. 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​
    Server turns red Figure: When the server turns red, the connections have been dropped and you're ready to update
  5. Optional – if you are using Hyper-V, take a snapshot of the server you are about to make changes on
  6. Restart
  7. Windows update Figure: Now that the server isn't being hit with users, perform your updates. Click "Restart Now"
  8. Optional – Do a smoke test (open the site and check its working)
  9. Optional – Run any automated tests (for example Telerik Tests)
  10. When the server ready, add it back into the load balancer. Right click on the machine | Select Control Host | Click Start
  11. The server icon will return to green, and users will start being sent to the server again
  12. Server OK Figure: The server will now accept connections again
  13. Follow the same process for the other server (or multiple)

Congratulations you've just updated your servers with 100% uptime.

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments: