SharePoint 2013 Request Management

Request Management is a new feature of SharePoint 2013. Request Management maintains the load on a SharePoint Farm.

Request Management allows SharePoint to understand more about and control the handling of, incoming requests for pages, documents and any other content that SharePoint may deliver to end users. The request management service uses a rule engine to make decisions about routing the traffic within the servers in the Farm.

Request management is available to all versions of SharePoint 2013, including foundation. You might think, what is the use of the load balancer in this case? The load balancer is the first level where the traffic is being distributed according to the rules, algorithm and various factors to the web front end servers. Request Management provides better granular control over which servers receive which requests, based on data in each request.

The Request Manager (the service running on each SharePoint server) provides the following three levels of operation:

  • Load balancing
  • Prioritization
  • Throttling and routing

The request management routes the traffic to the servers based on routing rules. The set of routing rules are grouped under an execution group. The WFE servers are grouped under machine pools. According to the rule satisfied the traffic is routed to the specific machine pools then to the WFE servers inside it respectively. Each server in a machine pool has a static weight and health weight that the routing rules use to determine the eligibility of servers to service requests. Static weights are numeric values assigned by administrators to weigh specific servers in the Farm, whereas SharePoint changes health weights as the performance and health of the server's changes over time.

Throttling rules are a rule that refuse the incoming traffic based on the set of rules assigned. A request with inappropriate data will trigger the throttling rule.

The request manager passes on the traffic based on the following criteria:

  1. The throttling rules filter any inappropriate data and thus refuses the connection.

  2. Routing rules are evaluated. The rules in execution group0 are evaluated first, then execution group1 and so on.

  3. Based on the matching rule the traffic is sent to the appropriate machine pool associated with the execution groups (routing rules).

There is no browser UI to configure the request management. We need to use SharePoint PowerShell management to configure it.

An existing request management setting for the SharePoint web application can be found using the following commands:

  1. $webapp = get-spwebapplication http://webapplication  
  2. $RequestMgmtSetting = $webapp | Get-SPRequestManagementSettings  
  3. $RequestMgmtSetting  
The following are PowerShell commands to configure machine pools and assign servers to them:
  1. $MachinePool1 = Add-SPRoutingMachinePool –RequestManagementSettings $RequestMgmtSetting -Name "Machine Pool 1" –MachineTargets @("Server1Name""Server2Name")  
Create one more machine pool using the following:
  1. $MachinePool2 = Add-SPRoutingMachinePool –RequestManagementSettings $RequestMgmtSetting -Name "Machine Pool 2" –MachineTargets @("Server3Name""Server4Name")  
Now add static weights to each server on the machine pools. This helps the request management to route the traffic to appropriate servers.
  1. $rmServerDetails = $RequestMgmtSetting | Get-SPRoutingMachineInfo –Name "Server1Name"  
Set-SPRoutingMachineInfo –Identity $rmServerDetails –StaticWeight 7

Repeat the preceding procedure for the remaining severs.

Use the following PowerShell commands to add a throttling rule when the user agent includes “Test”. That rule will prevent any search engine with the word “Test” in the user agent from issuing requests.
  1. $matching = New-SPRequestManagementRuleCriteria –Property UserAgent –MatchType Regex –Value ".*Test.*"  
  2.   
  3. $RequestMgmtSetting | Add-SPThrottlingRule –Name "Refuse Test Agents" –Criteria $matching  
Now it's time to add the routing rules that bind to the machine pool, the following commands create a routing rule that sends all the Word document requests to the servers in machine pool 1.
  1. $matching1 = New-SPRequestManagementRuleCriteria –Property Url –MatchType Regex –Value ".*\.doc"  
  2.   
  3. $rule = Add-SPRoutingRule –RequestManagementSettings $RequestMgmtSetting –Name "Handle word doc Requests" –ExecutionGroup 0 –MachinePool $MachinePool1 –Criteria $matching1  
You can have a look at the created rules using the following command:
  1. Get-SPRoutingRule | $RequestMgmtSetting  
The preceding PowerShell commands provide you an idea of how to configure request management for your SharePoint Farm. But you need to have a look into It deeply and understand the parameters that you can pass on for the property and matching parameters.