简体   繁体   English

回顾为每个网站/应用程序创建单独的IIS应用程序池

[英]Drawback to creating a separate IIS application pool for each website / application

Currently, on our production IIS web farm, we host about 15 applications in a single App Pool (Default App Pool). 目前,在我们的生产IIS Web场中,我们在一个应用程序池(默认应用程序池)中托管了大约15个应用程序。 There are two websites and about 13 virtual directories. 有两个网站和大约13个虚拟目录。

A colleague has recommended that we change our IIS configuration so each application is a separate App Pool (with identical settings). 一位同事建议我们更改我们的IIS配置,以便每个应用程序都是一个单独的应用程序池(具有相同的设置)。

Is there any drawback or potential issues to doing this? 这样做有任何缺点或潜在问题吗? Is it possible that ASP.NET applications could have been built with the requirements that they are all within the same App Pool? 是否有可能构建ASP.NET应用程序的要求是它们都在同一个应用程序池中?

I doubt they were built with that requirement in mind unless they rely on shared memory for some reason. 我怀疑他们是否考虑到了这个要求,除非他们出于某种原因依赖共享内存。 Otherwise, for the scenario described... 否则,对于描述的场景......

Pros (of separate app pool): 优点(独立的应用程序池):

  • process isolation (one crash doesn't bring down the others) 进程隔离(一次崩溃不会导致其他崩溃)
  • less resource contention 减少资源争用
  • more memory available for in-proc sessions, cache 更多可用于进程内会话的内存,缓存

Cons: 缺点:

  • more processes, memory, and context switchces 更多进程,内存和上下文切换
  • shared cache scenarios no longer available* 共享缓存方案不再可用*

*I'm not sure how .NET segregates websites in the same app pool as it pertains to the HttpRuntime cache; *我不确定.NET如何在与HttpRuntime缓存相关的同一个应用程序池中隔离网站; for Sessions , "application uniqueness" (1) is determined by: 对于Sessions ,“应用程序唯一性”(1)由以下因素确定:

  • The physical path on all servers (case sensitive) 所有服务器上的物理路径(区分大小写)
  • The machine key 机器钥匙
  • The instance id 实例ID
  • The approot 批准

This is what prevents you from sharing sessions across different websites in the same app pool, for instance; 例如,这就是阻止您在同一个应用程序池中跨不同网站共享会话的原因; but it might be easier to share cache data though. 但是,共享缓存数据可能更容易。 By and large, the discussion overlaps with the pros/cons of deploying a Web Garden for a specific application (2). 总的来说,讨论与为特定应用部署Web Garden的优缺点重叠(2)。

1) 1)
http://support.microsoft.com/?id=325056 http://support.microsoft.com/?id=325056
http://rodiniz.spaces.live.com/blog/cns!F2A56AAF89A7E43A!658.entry http://rodiniz.spaces.live.com/blog/cns!F2A56AAF89A7E43A!658.entry

2) 2)
http://nicholas.piasecki.name/blog/2009/02/on-web-gardens-aspnet-and-iis-60/ http://nicholas.piasecki.name/blog/2009/02/on-web-gardens-aspnet-and-iis-60/

Besides the configuration time and (maybe) more memory requirements there is no down side to using more than one App Pool. 除了配置时间和(可能)更多内存要求之外,使用多个App Pool没有任何不利因素。

(Just to be clear... the memory needed will vary depending on many factors -- but there is a way where 15 apps in one pool use more memory than 15 apps in 15 pools. If each app does not need much memory and the apps are used at different times and infrequently.) (只是要明确......所需的内存会因许多因素而有所不同 - 但有一种方法是,一个池中的15个应用程序使用的内存比15个池中的15个应用程序多。如果每个应用程序不需要太多内存,应用程序在不同的时间使用,而且很少使用。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM