Request Management Administration
There is no browser user interface for
Request Management in SharePoint 2013. Instead, administration of
Request Management is via PowerShell Cmdlets.
The following example demonstrates how to get access to the Request Management settings for a particular web application:
You should see a list of settings for the Request Manager associated with the web application. Figure 2
shows a screenshot from my console when I executed the previous
PowerShell Cmdlets to retrieve the Request Management settings for my
default web application.
The following set of steps demonstrates how to create a couple of machine pools:
- 5. Type the following PowerShell Cmdlets into the console:
$pool1 = Add-SPRoutingMachinePool –RequestManagementSettings $rmSettings
-Name "Machine Pool 1" –MachineTargets @("Server1", "Server2")
- 6. The previous PowerShell assumes Server 1 and Server 2 belong to a new machine pool, called Machine Pool 1.
- 7. Add another machine pool, as follows:
$pool2 = Add-SPRoutingMachinePool –RequestManagementSettings $rmSettings
-Name "Machine Pool 2" –MachineTargets @("Server3")
- 8. The previous PowerShell assumes Server 3 belongs to a new machine pool, called Machine Pool 2.
- 9. Now to add some static weightings for servers in the pools.
- 10. Enter the following PowerShell Cmdlets:
$rmServerInfo = $rmSettings | Get-SPRoutingMachineInfo –Name "Server1"
Set-SPRoutingMachineInfo –Identity $rmServerInfo –StaticWeight 8
- 11. Repeat step 10 for each server in both pools.
- 12. With the machine pools created and servers in those pools, I will demonstrate adding a throttling rule.
- 13. Type the following PowerShell Cmdlets to add a throttling rule
when the user agent includes “Robot”—this rule will prevent any search
engine with the word “Robot” in the user agent from issuing requests.
$criteria = New-SPRequestManagementRuleCriteria –Property UserAgent –MatchType Regex –Value ".*Robot.*"
$rmSettings | Add-SPThrottlingRule –Name "Refuse Robot Agents" –Criteria $criteria
- 14. Now to add some routing rules, which bind to machine pools. Enter the following PowerShell Cmdlets:
$criteria = New-SPRequestManagementRuleCriteria –Property Url –MatchType Regex –Value ".*\.pdf"
$rule = Add-SPRoutingRule –RequestManagementSettings $rmSettings –Name "Handle PDF Requests" –ExecutionGroup 0 –MachinePool $pool1 –Criteria $criteria
- 15. The previous PowerShell Cmdlets create a new request rule that
forwards all requests for PDF files to Machine Pool 1. The rule resides
in Execution Group 0.
- 16. Experiment by creating more throttling and routing rules. Once
complete, you can survey the rules with the following PowerShell
Cmdlet:
Get-SPRoutingRule | $rmSettings