Servers rarely use more than 20 percent of their available processing power. This gives systems administrators plenty of comfort, as there’s ample overhead should an application or process require that little bit extra to complete a task. But with so many CPU cycles left idle, it seems a shame not to put them to some good use.
While it may be wise to allocate one server per role, such as one server for Exchange and another for SQL, there are occasions when multiple processes or applications competing for processor and memory resources can successfully be managed on one server. Two examples of this are IIS and Terminal Services, which Windows System Resource Manager supports natively.
WSRM can guarantee that an application receives a minimum share of available processor resources when there is high overall processor utilization. It also can control processor affinity. Processes can be assigned a maximum memory working set (the total physical RAM used by a process), though this is not recommended unless it improves performance in some measurable way. Limiting a process memory working set tends to cause disk thrashing if the limit is regularly exceeded, which typically lowers overall server performance.
To control an application that is prone to memory leaks, there’s the more useful ability to terminate an application (or write to the event log) should the application exceed a predefined level of memory usage. Although it’s not possible to restart a process with WSRM, you can use Windows Server 2008’s Event Viewer to launch a custom task that will restart an application on a given event. This will return memory usage to normal, if only temporarily.
WSRM can also manage resources according to date and time, and to a limited set of hardware conditions such as addition of processors or memory and changes in the availability of cluster nodes and resource groups. By grouping processes according to user or group, you can use WSRM to give higher priority to important users, which can be useful on terminal servers or to ensure access for administrators.
WSRM is a feature of Windows Server 2008 that’s installed using Server Manager. Log on as Administrator and open Server Manager from the Start menu:
To test different WSRM configurations, you might want to consider creating artificial scenarios in which applications compete for processor or memory resources. There are plenty of resource-hogging applications out there, but getting them to overload your system on demand isn’t easy.
Prime95 is an application that’s used by PC enthusiasts to stress-test systems that have been overclocked. Prime95 was developed to find new Mersenne prime numbers. If you’re good at math, that’s: Mn = 2n – 1. The applications used in this article to test WSRM are two different versions of Prime95, renamed Application1 and Application2 respectively. It’s not possible to run multiple instances of the Prime95 executable, but you can run the latest version and an older version at the same time. (Prime95 is available at www.mersenneforum.org.) For testing CPU management, I set Prime95’s Run a Torture Test setting to Small FFTs; and for memory testing, I set it to Blend.
WSRM uses Resource Allocation Policies to dynamically assign processor resources and limit memory consumption. There are four predefined Resource Allocation Policies that can be used to manage server resources easily without any configuration. Equal_Per_Process divides processor resources equally between applications when overall CPU utilization is above 70 percent. Equal_Per_User groups processes by the user account under which they run, and then shares CPU time evenly between each group of processes. Equal_Per_Session groups processes by terminal service session and Equal_Per_IISAppPool groups by IIS application pool.
You can make any one of these default Resource Allocations Policies active by opening WSRM from Administrative Tools on the Start menu, expanding Resource Allocation Policies in the left pane, right clicking the policy you want to make active and selecting Set as Managing Policy from the menu. WSRM includes a list of processes that are excluded from management by default, and you can add to this list by right clicking Windows System Resource Manager (Local), selecting Properties from the menu and then switching to the Exclusion List tab.
Let’s create our own policy to get a better understanding of how WSRM works. In this simple scenario there are two applications, Application1 and Application2, both competing for maximum processor resources. Application1 is a mission-critical application, and must be given priority access to CPU resources.
Log on as Administrator and open WSRM from Administrative Tools on the Start menu:
Now that our Resource Allocation Policy has been created, let’s run Application1 and Application2 together to see if WSRM successfully allocates CPU resources in favor of Application1.
Let’s modify our Resource Allocation Policy and configure it to terminate Application1 if it uses more than 200MB.
Windows Server Resource manager is included in all editions of Windows Server 2008 and provides instant value for heavily loaded terminal and web servers with its predefined Resource Allocation Policies. For more granular control of server resources, it’s easy to create new policies, which can be swapped in and out according to a schedule, helping to tune server performance according to demand at peak periods. Important users can be given priority for applications running locally or through Terminal Services. WSRM is a useful tool for improving server performance and in certain scenarios can help increase the return on investment from your server hardware.