2

I'm developing an asp.net mvc web site that will be deployed on web farm environment. So I've been searching things that I have to consider on programming level.

But most of things that I've found are about IIS setting like session management. Only one thing was related to development like below.

  • Object that will be stored on session variable should be implemented serializable.

Isn't there really anything else to be considered for web farm environment on programming level?

Anyone can help me to clear this issue?

unor
  • 92,415
  • 26
  • 211
  • 360
genki98
  • 680
  • 1
  • 11
  • 31

2 Answers2

2

The most important rule of thumb when designing an application that will run in a web farm is this application to be stateless. This means that you shouldn't be storing anything in memory.

If you application depends on Session or TempData, that's the first indication that you will have problems.

Another important aspect to take into account if you are using FormsAuthentication is to properly configure the machine keys of all nodes to use the same value. Otherwise an authentication cookie emitted by one node won't be able to be decrypted on another node and the user will be considered as non-authenticated even if he has a cookie.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Thanks for the advice. So you are talking about things on design and IIS management level, not on code level right? And I couldn't find any more code specific considerations, at first I thought there should be somethings that have to be done on code level like session state, static variables and so on though. So I started to think there wouldn't be much different on code, most of things related to web farm can be handled on different level. – genki98 Jan 16 '14 at 09:28
1

Below is a link to a series of articles that might give you an overview of web farms in the context of IIS and .NET. The articles target audience is programmers who want to get started with web farms and the MS technologies built around them. They are targeted at IIS 7.5 and .NET 4.5 but they most likely will work fine with IIS 7.0 and .NET 4.0 as well and things should not be too different in IIS 8.0 either.

http://dotnetcodr.com/2013/06/17/web-farms-in-net-and-iis-part-1-a-general-introduction/

Also, have a look at the accepted answer for this post Make an ASP.NET MVC application Web Farm Ready

Community
  • 1
  • 1
StackTrace
  • 9,190
  • 36
  • 114
  • 202
  • I've read those articles already. But I thought there should be something more. Thanks anyway!!! – genki98 Jan 16 '14 at 09:30