P.Brian.Mackey
P.Brian.Mackey

Reputation: 44285

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 browsers.

RESULT
IE: Usually pulls session properly. Session failed after letting the website sit idle for ~3 minutes.
FF: Session never rarely failed. After sitting ~15 minutes Session failed.
BB: Regularly fails. Ratio is inline with what Source2 says. The greater the # of worker processes in the Garden, the more likely it is Session fails.

My Interpretation
FF/IE/Desktop browsers have more memory which may allows for better caching.

Notes
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.

Upvotes: 0

Views: 934

Answers (1)

Hector Correa
Hector Correa

Reputation: 26690

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

Upvotes: 2

Related Questions