Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate application pools for ASP.net applications in IIS

I've read recommendations that we should create separate application pools for each asp.net application on our Win2008 server.

We have about 20 apps that would be on the same server. I know this would create 20 separate worker processes which seems very wasteful.

Is it good practice to create separate application pools for each application?

like image 733
spaetzel Avatar asked Aug 13 '09 18:08

spaetzel


People also ask

Can one web application have multiple application pool?

Yes, create "Applications" out of each sub folder. Than the application can have a separate application pool, the same will work for Virtual Directories.

Why would you need more than one application pool in IIS?

Since each pool runs in its dedicated process, an error in one app won't take down applications in other application pools. Additionally, you might want to use application pools to configure different levels of security for different applications.

What are the various application pool in IIS?

Application pools can contain one or more worker processes. Each worker process represents work being done for a Web site, Web application, or Web service. You can create a Web garden by enabling multiple worker processes to run in a single application pool. In IIS 7 and later, each application pool uses one of two .


2 Answers

Reposted from ServerFault, "Why add additional application pools in IIS?"

  • AppPools can run as different identities, so you can restrict permissions this way.
  • You can assign a different identity to each app pool so that when you run task manager, you know which w3wp.exe is which.
  • You can recycle/restart one app pool without affecting the sites that are running in different app pools.
  • If you have a website that has a memory leak or generally misbehaves, you can place it in an app pool so it doesn't affect the other web sites
  • If you have a website that is very CPU-intensive (like resizing photos, for instance), you can place it in its own app pool and throttle its CPU utilization
  • If you have multiple websites that each have their own SQL database, you can use active directory authentication instead of storing usernames/passwords in web.config.
like image 127
Portman Avatar answered Sep 30 '22 20:09

Portman


Separating apps in pools is a good thing to do when there's a reason, and there are a number of good reasons listed above. There are, however, good reasons not to separate apps into different pools, too.

Apps using the same access, .NET version, etc. will run more efficiently in a single pool and be more easily maintained. Most annoyingly, IIS will kill idle app pools, requiring the pool be recreated on each use. If you isolate infrequently used apps you'll impose an unnecessary startup cost on users. Combining these apps into a single pool will make for happier users when they don't pay the startup cost, happier servers when they don't give memory to multiple processes and CPU slices for them, and happier admins when they have to manage fewer app pools.

like image 42
codepoke Avatar answered Sep 30 '22 19:09

codepoke