Re: Site Maintenance - HttpModule

Tech-Archive recommends: Fix windows errors by optimizing your registry



nospam@xxxxxxxxxxx wrote in news:70ad52dc-6de1-4cba-84fe-dae40860d304
@h8g2000yqm.googlegroups.com:

All

Architecture:
An aspnet website serves as the interface for several scalable
applications.

Problem:
The ability to put the website into maintenance mode is required. The
maintenance mode needs to be selective - conditional on origination IP
address to allow internal personnel to view the site during a
deployment operation, and either the whole site or certain sections
may need to be selectively put into maintenance. Also, we want to
minimise the risk of killing a user's session while they are in the
middle of a workflow operation.

I am running out of time this morning, so I will have to examine
thoughts later. Here are a couple of things that can help.

1. Depending on how you are caching user information, you can often
"maintain" provided it is just a short "update the code" without killing
the user if you set up session state in SQL Server. This slows down
session state a bit (not bad), but takes the session out of the server.
You can also use an external session server (separate from all boxes in
the web farm) to accomplish the same thing, but that requires a separate
box, which you may or may not have.

2. For updating a site, it is better to stage on the local server in
another folder. You then set up a separate "site" to run through and
sanity check the deploy. As long as both sites are set up equivalently
in IIS, you should have no issue, as you are on the same box. Once you
are comfortable with the changes, xcopy over to production, except
perhaps the web.config (if you have different versions).

NOTE that you can still munge up a user in a single web box scenario if
he hits the site right as you are copying bits over, so nothing is
foolproof. But, with most sites, a local copy of the bits takes a few
seconds, so the likelihood you hit someone in mid request is pretty
small.

A better option is to have a web farm for the site(s) you manage. You
still need an external session mechanism (SQL or session server), but
you can take one server down and upgrade (even check the validity of the
code locally) and then bring it back up and start on the other server
(s). The user will never know any box went down if they are working, as
there is always a box that is serving them

I looked briefly at your HTTP Module methodology. I will have to think
about it, but it seems it could work. The question is why would you
incur this much work if you can simply move state off the web boxes (can
be done in the web.config).

Oh, one gotcha on a web farm. Make sure you manually set the keys in the
web.config file, as two machines will generate separate session keys
(ouch). I tend to do this out of habit, as it sets me up for web farming
from the start.



--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

******************************************
| Think outside the box! |
******************************************
.



Relevant Pages

  • Re: Web Farms and session handling
    ... > Hi John, ... > with our own custom module, that may help implement our own session ... your current server should hardly notice it. ... > |> Our setup is with a web farm, one ldap server and a database cluster. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Storing application specific information
    ... application cache but I was concerned because of the web farm architecture ... Yes, it will be retrieved once for each server in a farm, ... You can configure session to use the Session ...
    (microsoft.public.dotnet.framework.aspnet)
  • Web Farms and session handling
    ... We have a problem which is correlated to web farms and session handling and ... Our setup is with a web farm, one ldap server and a database cluster. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Session TimeOut and Web Farm
    ... I am creating a web service that will be hosted on a web farm. ... The web service also uses sessions to store user specific data. ... If in the web.config file for the web service application, a different value for session timeout is set on each server hosting the web service application, what takes precedence? ... I plan to use state server or SQL server to store session state. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Session Timeout and Web Farm
    ... I am creating a web service that will be hosted on a web farm. ... The web service also uses sessions to store user specific data. ... If in the web.config file for the web service application, a different value for session timeout is set on each server hosting the web service application, what takes precedence? ... I plan to use state server or SQL server to store session state. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)