Recipe 12.22. Isolating Applications into PoolsProblemYou want to isolate an application from other applications so that when the application fails, it won't bring down other applications on the server. SolutionUsing a graphical user interface
Using a command-line interfaceThe 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 DiscussionIn 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:
The choices for application isolation in this mode are:
See AlsoRecipe 12.19 |