Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 7 '12 at 8: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 Rinea Mar 7 '12 at 8:24
    
However if for any reason I would need to use sessions I would prefer SessionState server or AppFabric Cache ('Velocity') :) –  Andrei Rinea Mar 7 '12 at 8: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 7 '12 at 8:40
    
Check this link iis.net/download/WebFarmFramework –  DaeMoohn Mar 7 '12 at 8:41
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
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 Rinea Mar 7 '12 at 10:54
    
In two application pools? Two virtual machines? –  DaeMoohn Mar 7 '12 at 12:10
    
Well, you see, two application pools for the same site? Or two sites having the same code put in two physical folders, each site responding to different IPs each of which registered in the load balancer... –  Andrei Rinea Mar 7 '12 at 12:50
    
Two virtual machines would definitely work but I guess the overhead would be worthless in my opinion. –  Andrei Rinea Mar 7 '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 7 '12 at 21:57
show 1 more comment

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.

share|improve this answer
    
Thank you for this idea! –  Andrei Rinea Mar 9 '12 at 15:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.