Using WSRM to manage IIS 7 AppPool CPU Utilization
In the past administrators used CPULimit Metabase Property in IIS to configure the maximum percentage of CPU time that the worker processes in an application pool are allowed to consume over a period of time. With the availability of Windows System Resource Manager (WSRM), setting CPULimit is no longer needed, moreover, it is not recommended.
WSRM enables administrators to control how CPU and memory resources are allocated to applications, services, and processes. Managing resources in this way improves system performance and reduces the chance that applications, services, or processes will interfere with the rest of the system. It also creates a more consistent and predictable experience for users of applications and services running on the computer.
WSRM integrates resource management with Web pools through a built-in policy called Equal_Per_IISAppPool. Policies in WSRM automatically switch to different resource allocations in response hardware to hot-add changes or cluster changes if running in a cluster configuration.
Turning Off the CPULimit Metabase Property
- Start the IIS Manager and connect to the target server
Click on the Application Pools node to view the available application pools, for each application pool open the Advanced Settings dialog by clicking Advanced Settings in the Actions panel.
Under the CPU section ensure that the CPU Limit property is set to 0 (default value).
Using the Built-in IIS Policy
- After installing the Web Role proceed to install Windows System Resource Manager.
Start WSRM by clicking the Windows Start button, select "Administrative Tool", and select "Windows System Resource Manager".
Start the Equal_Per_IISAppPool built-in policy.
a. Open the Resource Allocation Policies node in the left-hand pane
b. Right click on Equal_Per_IISAppPool in the left-hand pane c. Select Set as Managing Policy d. If prompted to disable the calendar, click OK
e. Observe the behavior of the system under an IIS load. You could use WCAT for simulating a load on the server. This tools is part of IIS 6.0 Resource Kit which can be downloaded from the following link: https://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en.
Creating a Custom IIS Policy (Optional)
Create at least 2 process matching criteria (PMC) for different AppPools:
- Right-click on the Process Matching Criteria node in the left-hand pane.
- Select New Process Matching Criteria.
The New Process Matching Criteria dialog appears.
- Enter a name for the PMC and click Add.
- The Add Rule dialog appears
- Select the Files or Command Lines tab
- Click in the area labeled "Included files or command lines" and type in a matching criteria.
Use the following format:
- Add lines to match additional AppPools (or any other processes) to this PMC.
- Click OK.
- Repeat the above steps for each additional PMC.
Create a resource allocation policy (RAP):
- Right click on the Resource Allocation Policy node in the left-hand pane.
- Select New Resource Allocation Policy.
- The New Resource Allocation Policy dialog appears.
Enter a name for the RAP.
- Click Add.
- The Add or Edit Resource Allocation dialog appears.
- Select the PMC (from the dropdown) this allocation should go to.
Enter the processor percentage to be allocated to the PMC.
- Click OK.
- Add Resource Allocations for all other PMCs to be managed by RAP.
- Click OK.
Activate the policy.
- Right click on the RAP created above.
- Select Set as Managing Policy.
- If prompted to disable the calendar, click Yes.
- Observe the behavior of the system while running an IIS load.