ASP.NET和应用程序隔离 [英] ASP.NET and Application Isolation

查看:117
本文介绍了ASP.NET和应用程序隔离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用IIS 6,是否基于应用程序池进行应用程序隔离?如果是这样,当一个应用程序池中有多个虚拟目录时,会发生什么情况?它们是否共享相同的内存,并且如果一个虚拟目录崩溃,其他所有应用程序也会崩溃?

解决方案

如果一个虚拟目录中的功能崩溃,是,它可能崩溃或损害同一应用程序池中的其他应用程序,包括其他虚拟目录中的应用程序.通过将它们放入单独的应用程序池中来保护您的应用程序.

虚拟目录不会自己隔离内存或资源.这也具有其他含义.例如,可以通过在同一应用程序池中的另一个应用程序中设置静态变量来影响一个应用程序中的静态变量.

在IIS 6中,应用程序池的要点非常简单:隔离应用程序,这样一个崩溃不会导致其余崩溃.在IIS 7中,这仍然是主要目的,但是.

编辑:需要说明的是:每个应用程序池都是它自己的工作进程",一个崩溃不会损害其他应用程序池.每个虚拟目录就是这样:一种使IIS就像在该目录下的目录一样工作的方法.当您创建一个虚拟目录时,该虚拟目录的名称和位置与其指向的文件夹相同,默认情况下,它实际上不会执行任何操作.除了使URL如您所愿之外,您可以使用虚拟目录有多种原因:您可以将其用于安全性.正如我们一直在讨论的那样,您可以使用它们将调用放入特定的应用程序池中.

人们通常将虚拟目录与Web应用程序等同起来,因为通常在这里您想通过Web应用程序使用虚拟目录的配置功能.<​​/p>

会话状态仅在Web应用程序中维护,而不在应用程序池中的所有Web应用程序中维护.要存储不同Web应用程序之间共享的值,您必须执行其他操作. ASP.NET缓存,cookie,数据库等.将不同的文件夹作为不同的虚拟目录放置在应用程序中单独的应用程序池会将它们置于不同的进程中,并破坏它们的共享会话状态.

Using IIS 6, is Application Isolation happen based on the Application Pool? If so, what happens when there is more than one Virtual Directory in one Application Pool? Do they all share the same memory and if one Virtual Directory crashes, all the other apps crash as well?

解决方案

If functionality in one Virtual Directory crashes, yes, it may crash or harm other applications in the same Application Pool, including those in other Virtual Directories. Protect your applications by putting them into separate Application Pools.

Virtual directories do not themselves segregate memory or resources. This has other implications as well. For example, your static variables in one application can be affected by setting static variables in another application in the same application pool.

In IIS 6, the point of an application pool is quite simple: to segregate applications so that one crashing does not bring down the rest. In IIS 7, that is still the main purpose, but there is a little more to it.

Edit: To clarify: Each Application Pool is it's own "worker process", and one crashing won't hurt other Application Pools. Each Virtual Directory is simply that: a way to make IIS act as if there was a directory at that place. When you create a Virtual Directory with the same name and location as the folder it points to, by default that doesn't really do anything. You can use virtual directories for a variety of reasons, in addition to making URL's be as you wish: You can use them for security. And you can use them to put calls into particular application pools, as we've been discussing.

People often equate Virtual Directories with Web Applications because that is usually where you want to use the configuring power of virtual directories--by web app.

Session State is only maintained within the Web Application, not amongst all the Web Applications in an Application Pool. To store values shared between different Web Applications, you'd have to do something else. The ASP.NET cache, cookies, db, etc. Putting different folders in your application as different Virtual Directories and Separate Application pools would put them in different processes and destroy their shared session state.

这篇关于ASP.NET和应用程序隔离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆