People who are new to hosting web apps on IIS (Internet Information Services) sometimes struggle with the concept of application pools. What is an IIS application pool? What purpose does it serve? In this post, weâ€™ll answer these questionsâ€”and more.
Weâ€™ll begin by offering a brief introduction to IIS itself. If youâ€™re already well acquainted with this piece of software, then the first section isnâ€™t for you; feel free to skip it. Those of you who choose to read it will learn a bit about IIS and the role it plays in the Microsoft stack.
After that, weâ€™ll proceed to cover the concept of â€œpoolsâ€ in the tech world. If youâ€™re an IT professionalâ€”especially in the field of software developmentâ€”you likely come across a reasonable number of â€œpoolsâ€ in your day-to-day work, so it makes sense to define those as well.
Then we get to the main point of the article: IIS application pools. Youâ€™ll see the definition of the IIS application pool, understand its purpose, and learn details about the different types of pools.
A Brief Introduction to IIS
IIS stands for Internet Information Services, as youâ€™ve seen in the introduction. Formerly known as â€œInternet Information Server,â€ IIS is a web server created by Microsoft.
The paragraph above summarizes what IIS is. We could leave it at that and call it a day, if not for the â€œweb serverâ€ part. You see, â€œweb serverâ€ is a somewhat ambiguous term, because it can mean two differentâ€”yet relatedâ€”things.
â€œWeb serverâ€ can mean a computer (which can be both a physical machine or a virtualized computer. ) It can also mean a type of software that runs on said computer. Both the hardware and software varieties of the web servers are there for the same purpose: they take and reply to requests.
Since Microsoft isâ€”or at least has been, for the most part of its historyâ€”a software company, it shouldnâ€™t take you long to understand that IIS belongs to the â€œsoftwareâ€ category of web servers. So, IIS is an application used to host and manage web applications/websites on Windows. It was introduced back in 1995 as a free add-on for Windows NT 3.51, and itâ€™s been part of the Windows NT family since then.
The Concept of â€œPoolsâ€ in Tech
Tech workers come across the concept of pools all the time in their works; this is especially true for software development. Since itâ€™s such a pervasive concept, itâ€™d make sense to dedicate a little time to define it.
According to Wikipedia:
In computer science, a pool is a collection of resources that are kept ready to use, rather than acquired on use and released afterwards.
You might think that the definition above doesnâ€™t sound that far from caching, and you wouldnâ€™t be far from the truth. Sure, there are differences between the concepts, but they also have a lot in common. Think of caching as storing values for later reuse, while pooling deals with resources.
The justification for adopting pools is usually performance; for instance, think about scenarios when acquiring some resources might present a high-cost. In situations like that, pooling might come in handy.
A common example would be a pool of database connections. Creating connections presents relevant costs, so itâ€™s advantageous to keep a pool of existing connections from which programming routines can obtain them, instead of creating new connections every time one is required.
IIS Application Pool â€“ What It Is, What Itâ€™s Used for
We started the post by giving an overview of IIS, proceeding to define the concept of â€œpoolsâ€ in tech. Now weâ€™re ready to put it all together and start answering the title question.
Defining the IIS Application Pool
After learning about IIS and understanding the meaning of the pool in Computer Science, defining the â€œIIS application poolâ€ should be almost trivial. An IIS application pool is a poolâ€”i.e., a collectionâ€”that houses applications on IIS. Each application pool consists of a process called w3wp.exe that runs on the server machine. Thatâ€™s pretty much it.
The question then obviously becomes: why? What is the purpose of application pools on IIS? What do you use them for? Are there implications for your apps?
IIS Application Pool: Understanding the Need
As the previous section just covered, you can think of an application pool as a collection or compartment of applications. An application pool can contain n apps, and it allows you to create isolation levels for your applications. Why would that be useful?
One reason to adopt application pools might be to ensure availability for your apps. 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. For instance, you have five applications. One of them requires a higher level of security than the other four. In this case, you could create two separate application pools for the two different groups of applications. You can configure each pool to run under a different user account, by specifying the identity for the Application Pool.
Finally, you might also want to run applications on different versions of the .NET framework. This is yet another case where the application pool might come in handy.
Going Deeper: Shared vs. Dedicated Application Pools
You can classify IIS application pools into two main categories: shared application pools and dedicated application pools.
Shared Application Pools
You call an application pool â€œsharedâ€ if it hosts several web applications running under it. Youâ€™d typically combine many applications into a single application pool if you want to preserve the memory of the server. As we have already mentioned, each pool consists of a w3wp.exe process. If you have ten applications, each one in its own pool, that means you have ten processes in execution. On the other hand, if you host all ten applications under a single application pool, you end up with a single w3wp.exe process running.
What about a dedicated application pool? Well, thatâ€™s exactly the opposite: you say a pool is dedicated when it only has a single application running on it. Isolating each app in its own pool enables you to have a more rigid separation between them. Also, as weâ€™ve already said, this compartmentalization prevents the crash of an app that brings other apps down as well.
Dedicated Application Pools
Here are some of the most important advantages of having dedicated application pools over shared ones:
- Isolating applications that demand more resources, so they donâ€™t harm the performance of the other applications.
- Preventing problems with one application bringing the other apps down
- Preventing an application accessing the data from another one.
- Having different settings (e.g., different .NET version) for different apps.
- Isolating low-trust applications in a restrictive, low privileges, environment to prevent them from getting unauthorized access to other apps.
The disadvantage of dedicated application pools boil down to resource usage: since each pool is its own process, more resources are required.
Which One Should You Pick?
Which type of pool should you use? Itâ€™s impossible to give a one-size-fits-all answer. Each case will be different and needs to be analyzed individually. However, weâ€™ll give you a rule-of-thumb you can follow to identify certain scenarios for a dedicated pool. Here it goes: prefer a dedicated application pool if your application matches at least one of the following criteria:
- Itâ€™s a critical application for some reason.
- Itâ€™s an application you donâ€™t fully trust (e.g., itâ€™s a third-party app).
- It consumes too many resources.
Those are some good reasons to prefer dedicated application pools. But as weâ€™ve said, this is only a rule-of-thumb. Donâ€™t follow it blindly, and never forget to exercise critical judgment.
IIS Application Pool: Learn How to Use It and Profit
Was that all there is to know about IIS and its application pools? On the contrary: all that youâ€™ve read is nothing but the tip of the iceberg. Now itâ€™s up to you to consider studying and learning more. An interesting next step would be learning how to monitor IIS performance: it sort of acts as a sequence to the topic of this post.If you want to go a step further, you should start checking out tools at your disposal. For instance, take a look at Retrace, which is an application performance management system by Stackify.