PhillyNJ
PhillyNJ

Reputation: 3901

Maximum Worker Processors and Sessions

I have a question is regards to Maximum Worker Processors and Sessions. In IIS7, When I have the Maximum Worker Processors set to 5, my browser could loose its session. For example, on my website the user would load a page and set the session with some data. If they clicked on another page, I would create a new session, however the new session would be null. When I set the Maximum Worker Processors to 1, the new session would not be null, which is what I want.

If you are asking why I am creating a new session, its because it could be a completely new set of data which is required for our intranet (e.g. placing orders).

Is the Session tied to a single worker process instance, a bug perhaps in IIS7 or maybe I could be creating our sessions incorrectly?

If the question requires more info, please let me know. I am curious as to why this is occurring.

Upvotes: 0

Views: 285

Answers (1)

Lex Li
Lex Li

Reputation: 63298

Please learn about what is ASP.NET session modes first,

http://msdn.microsoft.com/en-us/library/ms178586.ASPX

When in-proc mode is used, sessions are bind to worker processes and cannot jump from one process to another.

Then you can learn about what is web garden,

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/659f2e2c-a58b-4770-833b-df96cabe569e.mspx?mfr=true

Multiple worker processes for the same application pool will definitely lead to the issue you observe, as if one creates a session for a user, the next request might come to another process when the previous session is lost.

Upvotes: 1

Related Questions