asp.netiisiis-manager

Application Pool vs Application Domain Recycling in Asp.net?


I'm a bit confused about the effects of recycling application pool and application Domain. as i red an high voted article as follows: What exactly is Appdomain recycling

It says that appdomain recycling is caused by any changes in settings or bin folder but as you can see below

enter image description here

Application pool is also recycled by configuration changes in a website that use this application pool, at this point three questions come to my mind

1.Firstly,is it reasonable to recycle application pool for any configuration changes made in website1 that also will affects website2 hence both of them use the same application pool?,Then what happens to isolation boundary between multiple applications that use the same application pool?

2.Secondly,What is exactly difference between AppPlool recycling and AppDoman Recyclyng?,Because both of them seems to do the same thing at the time of recycling?

3.Based on the picture above,Can we come to this conclusion that configuration changes will recycle AppDomain for sure but not necessarily AppPool ?


Solution

  • Your questions

    1. Application config changes will not restart Application Pool. Configuration changes restart AppDomain and each App has a different AppDomain which takes care of boundary and isolation.

    2. AppDomain Recycle is unloading and then reloading the AppDomain from w3wp process and doesn't restart the process. But Application Pool Recycle is unloading the corresponding w3wp process(es) of the Application Pool.

    3. Yes, application config changes will recycle AppDomain, not the Application Pool.

    Application Pool Recycle vs AppDomain Recycle

    I believe this summary (based on the links at bottom of the post) will help you to get a better understanding of Application Pool Recycle and AppDomain Recycle.

    AppDomain Recycle

    There are cases where an application domain must be unloaded from memory, reloaded, and the code re-jitted. This process does not terminate the worker process (w3wp.exe) and therefore does not affect other application domains assigned to the same pool.

    Application Pool Recycle

    An application pool recycle is when the all of the worker processes (w3wp.exe) for an application pool are unloaded and new instances are started to serve incoming requests.

    AppDomain Recycle Circumstances

    The following circumstances will cause a recycle of an application domain:

    Application Pool Recycle Circumstances

    Circumstances that can cause an application pool recycle to occur:

    More information