Web Servers - Do you get Zero Downtime when Updating a Server?

Last updated by Tom Bui [SSW] 5 months ago.See history

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
Server down, site up
Figure: Good Example – When one server goes down, the website remains up Then, use a Network Load Balancer (we recommend Microsoft’s build in NLB) which allows you to spread website 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
    Server drainstop
    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
    Server netstat
    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 red
    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
    Server restart
    Windows update
    Figure: Now that the server isn't being hit with users, perform your updates. Click "Restart Now"7. Optional – Do a smoke test (open the site and check its working)
  7. Optional – Run any automated tests (for example Telerik Tests)
  8. When the server ready, add it back into the load balancer. Right click on the machine | Select Control Host | Click Start
  9. The server icon will return to green, and users will start being sent to the server again
    Server green
    Server OK
    Figure: The server will now accept connections again11. Follow the same process for the other server (or multiple)

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

We open source. Powered by GitHub