tags:

views:

539

answers:

1

Looking at implementing load balancing for Windows hosted web sites on IIS, but want to know of the issues involved in doing so. Website are ASP.NET - with a mix of custom authentication and ASP.NET Authentication. For example:

  • Files : store on networked share obvious choice, but I expect it will put a lot of demand on the file server, making the websites slow and possibly resulting in the "network BIOS command limit has been reached" issue, or slowing down other data traffic
  • Session state : best to store in a SQL database, to prevent issues when responses come from a different server? How to do this? A web.config setting I presume?
  • Server downtime : when a server goes down (crash, hardware failure etc) or is updated, will the web sites still function?
  • DNS : As it is load balanced, I assume sites will need two IP addresses? Using Microsoft DNS

Regarding the files, could they easily be synced between servers? There may be up to 8MB files (occasionally bigger). DFS is an option that may be considered in the future, but are there other technologies (besides robocopy) that can be used?

A: 
  • Files: Pointing to a network share solves some problems and introduces others, such as a single point of failure. Clustering the fileshare mitigates that a bit, but you still have a single copy of the data. I prefer a shared nothing approach where the content is local to each webserver, eliminating the SPOF and removing the network from the equation when serving content. I'm currently using robocopy to do this, not DFS - don't like the AD tie in, constraints on server placement in a zoned network infrastructure. Robocopy is not ideal, either.

  • Session State - agree, ASPState SQL database. Make sure you set up a common machinekey in your web.config for all of your servers, though, while I'm thinking about this.

Drop<sessionState allowCustomSqlDatabase="true" cookieName="yourcookiname" mode="SQLServer" cookieless="false" sqlConnectionString="connnstringname" sqlCommandTimeout="10" timeout="30"/>

and <connectionStrings> <add name="connstringname" connectionString="Data Source=sqlservername;Initial Catalog=DTLAspState;Persist Security Info=True;User ID=userid;Password=password" providerName="System.Data.SqlClient"/> </connectionStrings>

into web.config. lastly, run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S sqlservername -E -ssadd -sstype p

  • Server downtime - the website will still fucntion when an individual server goes down. This depends on your webserver, of course - make sure it's not using 'ping' as the sole metric to determine if it should be sending requests to that webserver.
  • DNS - single entry. Shame that HTTP isn't SRV record aware.
JohnW
Any example of how to use RoboCopy to do this copy between servers (including permissions)?
Sam