Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What is the advantage of upping the "Maximum Worker Processes" from the default of 1 in IIS?

Given that it seems any worker process can reply to a request from a single client (ie they are not assigned a client) and that session variables are only accessible from the process they were created in, in what situation would it be advantageous to increase this setting?

I ask because one of my web applications was having all sorts of issues with session variables (random logging out etc) - it turns out a server tech had upped this to 4, thinking he was doing good. Returned it to 1 and the application is happy.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The only real advantage of increasing the number of worker processes is if you've got some long running process that's blocking the other threads from running - in which case you might want to consider adding another Worker Process.

However, as you've found this basically spools up another instance of w3wp.exe with it's own memory space that doesn't share in-process information between them, so you need to ensure you're set up for session sharing (MachineKey has been set, session is stored in a database or Session Service, etc.). A better option would be looking to see if you can offload the long running process to a separate process altogether.

share|improve this answer
    
That makes sense yes - is there any way to force a process to reply only to its own sessions? Luckily the site I'm currently working on only currently gets around 1000 requests a day, so load isn't an issue. –  Darkcat Studios Aug 8 '12 at 14:50
    
No, I don't think there's a way to direct a request to a particular wp - hence the notes about configuring session sharing. –  Zhaph - Ben Duguid Aug 8 '12 at 15:48
    
You may want to look into IIS web gardens‌​, if you application supports it. –  nojak Aug 14 '12 at 1:20
1  
It's important to make the distinction between long running processes that are blocked by I/O operations (or making distributed calls) and those that are simply grinding away CPU time. Adding a worker process in the latter scenario will not help. It will make it worse, because your OS/CPU will now cycle between multiple processes doing work. That's more overhead for the CPU process, reducing capacity. –  Frederik Feb 28 '13 at 18:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.