Application Pools in Microsoft IIS

Microsoft Internet Information Server (IIS) 6.0 introduced the concept of Application Pools.  At a basic level, Application Pools are simply a way to isolate one or more applications into their own process.  For example, if you have two applications you are hosting on an IIS server, you can isolate them into their own individual pools so that if one of application crashes, it does not impact the other application.  Application pools also have their own memory space.  For each application pool that you create in IIS, a new World Wide Web (W3) Worker Process (wp) w3wp.exe process will run on your machine.

Iron Speed Designer applications have no special requirement for application pools.  The best practices for any Microsoft .NET applications also apply to Iron Speed Designer applications.

Isolate Each Application

You can run as many applications in one application pool as you desire.  However, for critical production applications, it is better to set up one application pool per application.  This allows each application pool to have its own memory space and errors within one application will not impact other applications running in other pools.

Microsoft .NET Framework does impose a limitation that each Application Pool can only run one version of the Microsoft .NET Framework.  So if you have some applications that require Microsoft .NET Framework 1.1 and others that require version 2.0, you must create two different application pools.  Note that Microsoft .NET Framework 3.0 and 3.5 are really Microsoft .NET Framework 2.0 from the perspective of all web applications.  So there is no requirement to separate applications using version 2.0, 3.0 or 3.5 of Microsoft .NET Framework into separate application pools.

Iron Speed recommends running each application in its own application pool.

Security

Just like setting up security for your application, you can also set up security for your application pool.  In general, the Network Service account has most privileges needed to run any Microsoft .NET application and should not be changed unless you are hosting sites for multiple companies.

There may be cases where the security settings for an application pool prevent your application from running properly.  In this case, it is best to temporarily upgrade the security to Local System to test the application to isolate the problem.

Iron Speed recommends using the default Network Service security for an application pool.

Recycling Worker Process

One of the biggest advantages of application pools is the ability to automatically recycle worker processes based on various criteria.  You can either recycle at a fixed time, after some elapsed time, after a maximum amount of memory is reached or simply after a number of requests have been processed.

In general applications it is a good idea to recycle processes on a regular basis.  For most applications recycling them at a regular time once a week is sufficient.  For some applications with a heavy load, it may be more appropriate to recycle applications once a day.   You can also set up recycling based on amount of memory used or the number of requests, but these are advanced topics and we recommend that you try to understand the implications of this in depth prior to utilizing these options.

Note that all session information is lost when a worker process is recycled.  For example, if a user is logged on to an application, since the users login information is saved in a session, the user will be forced to login again.  Any additional information such as navigation history saved in the session will also be lost when the worker process recycles.  We recommend that worker processes should be recycled during low user activity in order to minimize user disruption.

Iron Speed recommends recycling worker process at a fixed time once a week for most applications, and once a day for applications that will be used by more than 25 end users.  Set the recycle time to occur at a time of minimal activity (such as midnight).  It is recommended that you recycle different processes at different times rather than recycling all pools at the same time.

Additional Reading

http://technet.microsoft.com/en-us/library/cc735247(WS.10).aspx

http://www.developer.com/net/asp/article.php/2245511

http://www.windowsnetworking.com/articles_tutorials/Working-Application-Pools-Internet-Information-Server.html

See Also

Configuring the Microsoft IIS Web Server

Configuring Microsoft IIS 7 for Microsoft Access Applications

Configuring Microsoft IIS on Microsoft Vista

Running as Administrator in Microsoft Vista

Installing Microsoft IIS on Microsoft Windows XP Professional

Installing Microsoft IIS on Windows Server 2003

Using Non-Standard Ports in Microsoft IIS

Application Pools in Microsoft IIS

Running Applications in 64-bit Mode