Proof that Web Gardens do not fly well with InProc Sessions
I am tinkering with Web Gardens in ASP.NET with IIS 6.0. Multiple sources (Source1 Source2) explain how InProc Session does not fly well with Web Gardens. I built a program to prove it, but the results are difficult to explain. Please help me explain the results of my testing.
TEST I set the Maximum # of worker processes to 1000 in IIS. I create a web app that stores a string in Session and retrieves the value with a button click. Run web app in IE, FF, and Blackberry br开发者_开发知识库owsers. RESULT IE: Usually pulls session properly. Session failed after letting the website sit idle for ~3 minutes. FF: SessionNotes
Setting IE to check for newer versions of a page on every visit has no effect. Noticed that postbacks from the Blackberry are pretty much guaranteed to create a new instance of w3wp.exe, whereas Mem usage increased for the same w3wp.exe process with postbacks from IE/FF.The fact that browsers have more memory shouldn't have anything to do with InProc Sessions and WebGardens as those are server side components.
You see more issues as you increase the number of worker processes because the more number of worker processes the less likely is that your request will be handled by the same worker process when it comes back. In other words if you only have one worker process you have a 1 in 1 chance that it will go back to the same worker process on a second request; if you have two worker processes you have 1 in 2 chances, if you have three worker process you have 1 in 3 chances, and so on.
I wonder why are you trying to use InProc Sessions, though. There is almost no good reason to as they can vanish very easily. See this article http://www.west-wind.com/Weblog/posts/1986.aspx
精彩评论