Application pool and AppDomain both of them can provide isolations.
Application Pool is in IIS whereas AppDomain is a in .NET.
Many time we get confused between App Domain and Application pool. Application Pool is an IIS property where as App Domain is related to .net applications.
Both app domain and application pool provide isolation
App domain is being provided by .net where as application pool is being provided by IIS
Lets talk about Application Pool first. For example, you have 3 web applications as app1,app2 and app3. Lets consider 3 different scenarios
Lets talk about Application Pool first. For example, you have 3 web applications as app1,app2 and app3. Lets consider 3 different scenarios.
In the 1st scenario, in your IIS, you have created 3 application pools as app_pool1,app_pool2 and app_pool3.And each of your web sites are tagged to each of these application pools. Now, when you run the three applications and goto the task manager, you will see 3 w3p processes running (assuming that the IIS does not have any other websites).
In the 2nd scenario, in your IIS, you have created 2 application pools as app_pool1 and app_pool2. You have assigned your app1 and 2 to app_pool1 and app3 to app_pool3. Now when you run the three applications and goto the task manager, you will see 2 w3p processes running(assuming that the IIS does not have any other websites).
In case of app domain, each application has its own application i;e app1 has its own app_domain and similarly app2 and app3.
Please refer to the following articles to know more about this.
App pool :
Application pools are used to separate set of IIS worker processes .
Applicationpools enable us to isolate our web application for better security, reliability, and availability
App Domain:
Every web applications that runs on seperate Application Domain .
An AppDomain contains InProc session state.So if an AppDomain is killed/recycled, all of your session state information will be lost.
Application Pool is in IIS whereas AppDomain is a in .NET.
Many time we get confused between App Domain and Application pool. Application Pool is an IIS property where as App Domain is related to .net applications.
Both app domain and application pool provide isolation
App domain is being provided by .net where as application pool is being provided by IIS
Lets talk about Application Pool first. For example, you have 3 web applications as app1,app2 and app3. Lets consider 3 different scenarios
Lets talk about Application Pool first. For example, you have 3 web applications as app1,app2 and app3. Lets consider 3 different scenarios.
In the 1st scenario, in your IIS, you have created 3 application pools as app_pool1,app_pool2 and app_pool3.And each of your web sites are tagged to each of these application pools. Now, when you run the three applications and goto the task manager, you will see 3 w3p processes running (assuming that the IIS does not have any other websites).
In the 2nd scenario, in your IIS, you have created 2 application pools as app_pool1 and app_pool2. You have assigned your app1 and 2 to app_pool1 and app3 to app_pool3. Now when you run the three applications and goto the task manager, you will see 2 w3p processes running(assuming that the IIS does not have any other websites).
In case of app domain, each application has its own application i;e app1 has its own app_domain and similarly app2 and app3.
Please refer to the following articles to know more about this.
App pool :
Application pools are used to separate set of IIS worker processes .
Applicationpools enable us to isolate our web application for better security, reliability, and availability
App Domain:
Every web applications that runs on seperate Application Domain .
An AppDomain contains InProc session state.So if an AppDomain is killed/recycled, all of your session state information will be lost.
A question was asked on a forum that I frequent which I thought was worth writting a blog about.
Q: What is the difference between an application and an Appdomain? I understand from my research so far that an Appdomain is a container within which ASPX runs and that Apppool is a process that starts the w3wp.exe worker process within which ASP applications run.
A: That's a good question. Here are some key differences:
- An application is an IIS term, but it's one that ASP.NET utilizes. Essentially it creates a sandbox, or a set of boundaries to separate different sites, or parts of sites, from the others.
- An AppDomain is a .NET term. (In IIS7, AppDomains play a larger role within IIS, but for the most part it's an ASP.NET term)
- An AppDomain contains InProc session state (the default session state mode). So if an AppDomain is killed/recycled, all of your session state information will be lost. (if you are using the default InProc session state)
- Applications can have multiple AppDomains in them although often times there is a one-to-one relationship between them.
- In IIS6 and greater, there is the option of creating groups, or "pools" of applications that can be bundled together or separated; however the server administer decides. These are called Application Pools. Each app pool runs under its own w3wp.exe worker process.
- In IIS, it's easy to see an application. A new website is a separate application and any subfolder can be marked as an application. When they are, the icon beside the folder turnes into a picture of some gears. By right-clicking on the folder, you have the option of marking a folder as an application or removing it as an application, if it already is one. Also, in IIS6, in the Application Pools section, you can see all of the applications and which app pool they live under.
- ASP.NET, on the other hand, doesn't give much visibility into AppDomains, at least not from any visual tools. This is done behind the scenes. Programmatically you can create them, tear them down or see a list of all running AppDomains.
- You can recycle an application from IIS. In IIS5, you can't do it directly unless you recycle the entire web server, but in IIS6 and greater, you can recycle the application pool that the application lives under. It will gracefully die off and a new application will start up to replace it. Or, to word it another way, another w3wp.exe worker process will be started and then the old one will die off after it completes any currently running page requests.
- You can recycle an AppDomain in ASP.NET through the 'touch trick'. There are a few ways to do it, but the most straight forward is to edit your web.config file in notepad and add a space to an insignificant place. Then save the file. This will cause the AppDomain to recycle. This *does not* touch the IIS application though.
- Recycling an AppDomain will come pretty close to starting ASP.NET fresh again for that particular ASP.NET application, so although it doesn't recycle the apppool, it can give ASP.NET a fresh start in many situations.
Comments
Post a Comment