5

I would like to host a single physical machine two copies of the same very site to minimize downtime during upgrades.

I think I could put a load balancer in front of the machine, assign two IPs to this machine and set the IPs in the load balancer.

The issue is when I need to update the site (its code not the infrastructure). I think I could minimize downtime by taking out one of the site's 'instance', upgrade it then bring it back online and do the same with the other one.

Is this feasible?

Is this worth it?

Andrei Rînea
  • 310
  • 5
  • 17
  • What are you going to do with the sessions opened on the first site? How are you managing them? In process? In sql server or in appfabric? – DaeMoohn Mar 07 '12 at 08:22
  • I do not intend to make any use of sessions at all. The authentication token (forms authentication) is no problem for this scenario. – Andrei Rînea Mar 07 '12 at 08:24
  • However if for any reason I would need to use sessions I would prefer SessionState server or AppFabric Cache ('Velocity') :) – Andrei Rînea Mar 07 '12 at 08:24
  • At all costs avoid sticky session (associating session information with server information). If you are going to have sticky session, then the clients of the offline instance will be terminated and would have to start over. That might not be business tolerable. – DaeMoohn Mar 07 '12 at 08:40
  • Check this link http://www.iis.net/download/WebFarmFramework – DaeMoohn Mar 07 '12 at 08:41

2 Answers2

3

Sure, this is what we do. We have two web servers, A and B. We have haproxy sitting infront of them, dutifully balancing requests between them. Like you, we don't store session data in a way that a request must go back to its originating server.

When we want to do an upgrade, we take Server A out of the pool. We perform the upgrade and test the site internally. Then, we put Server A in the pool, and at the same moment, take Server B out of the pool. We then upgrade Server B, and put it back in.

Upside: Site upgrades with 0 downtime.

Downside: During the upgrade you have no load balancing or redundancy. To solve this you have to many more servers into the mix.

As to whether or not it's worth it, only you can answer that. Our software is incredibly complex and a deployment can take upwards of 5 minutes (and that's with it being fully automated), and it's in use pretty much 24/7. So it was a no brainer for us.

If your site only gets traffic sporadically throughout the day, or mostly during say, working hours, and you're not pushing the barriers of what a single web server can handle, then it might not be worth the hassle. Throwing up a maintenance banner for 10 seconds while svn export runs might be a more appropriate solution.

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
  • 1
    Thanks! One side of my uncertainty is that I would have only one physical machine and I would have to host two "instances" (don't exactly know the best term for this) of the same site in the same IIS. Is **this** feasible? – Andrei Rînea Mar 07 '12 at 10:54
  • In two application pools? Two virtual machines? – DaeMoohn Mar 07 '12 at 12:10
  • Well, you see, two application pools for the same site? Or two `site`s having the same code put in two physical folders, each site responding to different `IP`s each of which registered in the load balancer... – Andrei Rînea Mar 07 '12 at 12:50
  • Two virtual machines would definitely work but I guess the overhead would be worthless in my opinion. – Andrei Rînea Mar 07 '12 at 12:50
  • 1
    @AndreiRinea - you would need to set up two sites in IIS, and bind each one to a different IP address. As for application pools, I don't know how your app works so I can't answer that for you. – Mark Henderson Mar 07 '12 at 21:57
2

Have a look at WebFarmFramework & ARR. WFF will automate the deployment of the code as well as IIS settings for you. Also, if you use it's load balancer, it will take the nodes offline for you while the upgrade happens.

I'm actually researching the same problem now so I can't vouch for this in production, just another idea to look at.

Steve Sloka
  • 260
  • 2
  • 8