应用程序域和应用程序池之间的区别?
应用程序域和应用程序池有什么区别?
我读过很多关于这两个术语的文章。但仍无法对它们有正确的了解。
请用简单的描述来详细说明。
谢谢
What is difference between application domain and application pool?
I have read many articles regarding these two terminology. but still unable to get proper understanding about them.
Please elaborate it with simple description.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIS进程是w3wp。 IIS 中的每个应用程序池都使用自己的进程。 AppPool1 使用进程 3784,AppPool2 使用进程 5044。
Asp.net中不同的应用程序会使用不同的
应用程序域。
AppTest1 和 AppTest2 位于不同的 AppDomain 中,但位于
相同的过程。
使用它们有什么意义?
应用程序池和AppDomain,两者都可以提供隔离,但使用的方法不同。应用程序池使用该进程来隔离无需.NET 即可运行的应用程序。但AppDomain是.NET提供的另一种隔离方法。如果您的服务器托管数千个网站,您将不会使用数千个应用程序池来隔离网站 - 运行太多进程会杀死操作系统。但是,有时您需要使用应用程序池隔离。应用程序池的优点之一是您可以配置
应用程序池的身份。此外,您还有更灵活的选项来回收应用程序池。至少现在,IIS 没有提供明确的选项来回收 AppDomain。
应用程序池是一组不同 Web 应用程序和网站的一个或多个 URL。任何 Web 目录或虚拟目录都可以分配给应用程序池。应用程序池中的每个应用程序共享相同的工作进程可执行文件 w3wp.exe,为一个应用程序池提供服务的工作进程与为另一个应用程序池提供服务的工作进程是分开的[例如启动 MS Word 并打开许多 Word 文档]。每个单独的工作进程都提供一个进程边界,以便当应用程序分配到一个应用程序池时,其他应用程序池中的问题不会影响该应用程序。这可以确保如果工作进程发生故障,不会影响其他应用程序池中运行的应用程序。例如,如果 Word 文档有问题,则不应
从逻辑上讲,它会影响您的 Excel 工作表,不是吗?应用程序域是一种机制(类似于操作系统中的进程),用于将执行的软件应用程序彼此隔离,以便它们不会相互影响。就像打开 Word 不会影响 Excel 一样,您可以随时打开和关闭这两个应用程序
应用程序之间不存在依赖关系。每个应用程序域都有自己的虚拟地址空间,该空间使用该地址空间来限定应用程序域的资源范围。
感谢此链接。
IIS process is w3wp. Every application pool in IIS use its own process. AppPool1 uses process 3784, AppPool2 uses process 5044.
Different applications in Asp.net will use different
AppDomain.
AppTest1 and AppTest2 are in different AppDomain, but in
the same process.
What's the point to use them?
Application pool and AppDomain, both of them can provide isolations, but use different approaches. Application pool use the process to isolate the applications which works without .NET. But AppDomain is another isolation methods provided by .NET. If your server hosts thousands of web sites, you won't use thousands of Application Pools to isolate the web sites - too many processes running will kill the OS. However, sometime you need to use Application Pool isolation. One of the advantages for Application Pool is that you can configure the
identity for Application Pool. Also you have more flexible options to recycle the Application Pool. At least right now, IIS doesn't provide explicit options to recycle the AppDomain.
An Application Pool is a group of one or more URLs of different Web applications and Web sites. Any Web directory or virtual directory can be assigned to an Application Pool. Every application within an Application Pool shares the same worker process executable, w3wp.exe, the worker process that services one Application Pool is separated from the worker process that services another [Like starting MS Word and opening many word documents]. Each separate worker process provides a process boundary so that when an application is assigned to one Application Pool, problems in other Application Pools do not affect this application. This ensures that if a worker process fails, it does not affect the applications running in other Application Pools. E.g. if a Word document is having issue it should not
logically affect your Excel sheet, isn’t it? Application domain is a mechanism (similar to a process in an operating system) used to isolate executed software applications from one another so that they do not affect each other. Much like how opening Word doesn’t affect Excel, and you can open and close both the applications any time since
there is no dependency between the applications. Each application domain has its own virtual address space which scopes the resources for the application domain using that address space.
Thanks to this link.