IIS app pools, worker processes, app domains, poolsdomains
Copy from http://stackoverflow.com/questions/14105345/iis-app-pools-worker-processes-app-domains
I try to say them with other words.
In a server you can have your asp.net sites that runs together. Each one site isApp domain.
You must assign to each of them oneApplication pool. Your application domains (sites) can have the same application pool, and because they have the same application pool they run under the same processes, and under the same account-and they have the same settings of the pool. if this pool restarts, then all sites under that pools restarts.
Now each pool can have one or moreWorker process. Each worker process is a different program that's run your site, have their alone static variables, they different start stop calletc. different worker process are not communicate together, and the only way to exchange data is from common files or a common database. if you have more than one worker process and one of them make long time calculations, then the other can take care to handle the internet calland show content.
When you assign your worker process to a single pool then you make the calledWeb gardenAnd your site is like to be run from more than one computer if a computer is one processing machine.
Each worker process can have worker threads.
How the more worker process affect you:
When you haveOne worker processEverything is more simple, among your application all static variables are the same, and you uselock
To synchronize them.
When you assignMore than one worker processThen you still continue to uselock
For static variables, static variables are not different among the specified runs of your site, and if you have some common resource (e.g. the creation of a thumbnail on the disk) then you need to synchronize your worker processMutex
.
One more note. Its sounds that when you makeMore worker processThen you may have more smooth asynchronous page loads. there is a small issue with the session handler of asp.net that is lock the entire process for a page load-that is good and not good depend if you know it and handle it-or change it.
So let talk about one site only with your worker process. Here you face the issue that you need to synchronize your common resource changeMutex
. But the pages/handlers that use session they are not asynchronous because the session locks them. This is good for start because you avoid to make this synchronization of your points your.
Some questions on this topic:
Web app blocked while processing another web app on sharing same session
JQuery Ajax callto web service seem to be synchronous
ASP. NET Server does not process pages asynchronously
Replacing ASP. Net's session entirely
Now this session lock is not affect different sites.
Among different sites the more worked process can help to not the one site block the other with long running process.
Also among different sites the more pools also can help, because each pool have at least one worked process, but remember and see by your self using the process explorer, each working process takes more memory of your computer, and one big server with 16G memory and one SQL server can not have too has different worked process-for example on a server with 100 shared sites, you can not have 100 different pools.