I am in a bit of confusion here. In IIS 5.0 all the ASP.NET applications run inside the same worker process(aspnet_wp.exe). The various applications are isolated by appdomain. I believe the fundamental functionality of an appdomain is to provide application isolation within a process. Now on to IIS 6.0. I have read about application pools in IIS 6. A lot of sites say that in IIS 5.0 when there is a problem with an application it affects the other applications. But isnt that safeguarded by appdomains? I am being told that application pools in IIS 6.0 prevent that mishaps. I am a bit confused here as to what exactly is advantage tha开发者_如何学编程t application pools provide over IIS 5.0. I have also been told that in IIS 6 worker process isolation mode, configuring different application pools(and thereby different worker processes) is a perfomant thing to do. But spawning new processes increases the memory utilization and how can it be claimed to be a performant way to do things? Also how does the HTTP.SYS know to route the request to the concerned application poool?
Don't get application pools and AppDomains confused. An AppDomain is a isolation boundary within a process. They are designed to isolate and provide security around managed code that is executing.
Application pools are a feature of IIS that allow a pool to handle requests for multiple sites. They handle this by running multiple AppDomain
instances in the worker processes (aspnet_wp.exe, or w3wp.exe). Although technically you can run multiple AppDomain
instances per site, generally it is a single AppDomain
per IIS Application.
If you have multiple sites in a single application pool (and this sharing the worker processes), if one of those sites starts consuming a lot of resources, this can directly effect the other sites running in the same application pool.
By grouping (and segregating) sites in logical groups (application pools), you can better manage how sites behave.
HTTP.SYS is a kernel mode driver stack that is part of the Windows subsystems. It provides management of the HTTP protocol in kernel mode (versions prior to IIS6 used winsock in user mode). With HTTP.SYS running at the kernel level, should a worker process fail, the request can be queued, and then forwarded to a new worker process which will be spun up.
When you create a site in IIS6, it registers the site with HTTP.SYS which can then route requests coming in to the appropriate worker process.
The Appdomain is about sharing data http://msdn.microsoft.com/en-us/library/system.appdomain.aspx and in IIS 6 you can append several applications to an application pool. If you have 2 applications in the same application pool and one of them keeps crashing, it affects the other and IIS will decide to shutdown the whole application pool because of the instability.
Therefore, if you have critical applications, it is recommended to keep them in their own application pool. If you have multiple apps in IIS, you route the requests with the hostheaders (or extra external IIP addresses)
extra resource that recommends an application pool for each production website: http://forums.iis.net/t/1151476.aspx
a nice resource which explains the difference between 5.0 and 6.0 with isolation: http://www.tech-faq.com/understanding-iis-5-and-iis-6.html
精彩评论