Recipe12.22.Isolating Applications into Pools


Recipe 12.22. Isolating Applications into Pools

Problem

You want to isolate an application from other applications so that when the application fails, it won't bring down other applications on the server.

Solution

Using a graphical user interface

  1. Create a new application pool for your application (see Recipe 12.19)

  2. Open Internet Information Services (IIS) Manager.

  3. In the left pane, expand the console tree and select the web site (or virtual directory) where your application starting point is defined.

  4. Right-click on the web site (or virtual directory) and select Properties.

  5. Select the Home Directory (or Virtual Directory) tab.

  6. Assign your application to the appropriate application pool and click Apply.

Using a command-line interface

The following command displays the process ID (PID) of all worker processes running on the computer, plus the application pool each worker process is assigned to:

> iisapp

The following command displays the application pool to which the worker process having PID 2765 is assigned:

> iisapp /p 2765

Using VBScript
' This code assigns an application to an app pool. ' ------ SCRIPT CONFIGURATION ------ strComputer = "<ServerName>" strAppPoolName = "<AppPoolName>" strApp = "<AppPath>" ' e.g., /W3SVC/1/Root/CGI ' ------ END CONFIGURATION ---------     set objVirtualDir = GetObject("IIS://" & strComputer & strApp) objVirtualDir.AppPoolId = strAppPoolName objVirtualDir.SetInfo( )     WScript.Echo "Application " & objApp.Name & _" isolated to App Pool " _              & strAppPoolName

Discussion

In previous versions of IIS, a poorly written application could cause the entire web server to fail. IIS 6 gets around this by allowing you to isolate applications into pools so that a badly-behaving application will affect only other applications running in the same pool, but have no impact on applications running in different pools. Note that application pools are available only in worker process isolation mode (to change isolation modes use the checkbox on the Services tab of the Web Sites Properties sheet).

To isolate an application when IIS is running in IIS 5 isolation mode, do this instead:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, expand the console tree and select the web site (or virtual directory) where your application starting point is defined.

  3. Right-click on the web site (or virtual directory) and select Properties.

  4. Select the Home Directory (or Virtual Directory) tab.

  5. Assign appropriate execute permissions to your application to isolate it as desired.

The choices for application isolation in this mode are:


Low (IIS Process)

The application runs in-process together with inetinfo.exe (not recommended because if the application fails, IIS itself will crash).


Medium (Pooled Process)

The application runs in a separate memory pool together with other designated applications (if any).


High (Isolated)

The application runs out of process in its own dllhost.exe host process.

See Also

Recipe 12.19



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net