I'm not sure if this is the right way to ask this question, but here's basically what i'd like to do:
1.) Push a changeset to a site in IIS.
2.) Don't interrupt the users.
3.) Be able to roll back effortlessly.
So, there are a few things that I know have to happen:
1.) Out of Proc session – handled
2.) Out of Proc cache – handled
So the questions that remain:
1.) How do i keep from interrupting the users? If i just upload the files to bin, the app recycles and takes 10+ seconds to come back online
2.) How do i roll back effortlessly?
I was thinking a possible solution would be to have two sites set up in IIS, one public and one private. Uploads go to private and get warmed up. After warmup, the sites are swapped. A rollback only entails swapping to private without an upload.
This seems sound in theory, but Im not sure of the mechanics. Any ideas?
Best Answer
Here is how I would approach this problem - keep in mind I haven't done this before, it is just concepts that I tested out a little bit in my dev environment. You should be able to setup a pretty robust framework using this and some scripting in your language of choice. Basically we are going to setup a ghetto load balancing environment and use that to switch between the new site and the old site.
To get it setup, you are going to need:
Install ARR to begin with.
Setup the 3 websites in IIS:
http://192.168.1.1/
. This is also the ARR site. Just setup an empty directory for this to point to, and put it in its own app pool. Setup the app pool to not timeout according to these instructions.http://192.168.1.2:8080
andhttp://192.168.1.3:8080
. They should also be in their own app pools, and point to different directories on the file system (but both directories have the same content typically)After installing ARR, there will be a new category in IIS Manager called "Server Farms" - right click that and create a new farm.
{SERVER_PORT}
does not match 8080At this point you have the basics of what we need to accomplish your request. If you go to
http://192.168.1.1/
you will get your website from either Website 1 or Website 2, but it will be completely seamless that there are other sites.Now what you can do when you want to deploy a new version of your application is:
The Web Deployment tool comes into play when you talk about wanting to script all of this. It makes it super easy to create a package for your application and deploy it from the command line. You can also then rollback that package easily if there are problems. ARR is also scriptable using the
Microsoft.Web.Administration
dlls.One other thing - if you are actually on Windows 2008 R2 (which is IIS 7.5) take a look at the Application Warmup module - it should make the warming up portion of this easier on you as well.