Set-ASAppServiceThrottling

Set-ASAppServiceThrottling

Enables service throttling and sets values of service throttling parameters at the specified scope (server, root, Web site, application, etc…).

Syntax

Parameter Set: SiteNameAndVirtualPath
Set-ASAppServiceThrottling [-SiteName] <String> [[-VirtualPath] <String> ] [-MaxConcurrentCalls <Int32> ] [-MaxConcurrentInstances <Int32> ] [-MaxConcurrentSessions <Int32> ] [-UseInherited] [-Confirm] [-WhatIf] [ <CommonParameters>]


Detailed Description

This cmdlets adds the serviceThrottling element to the configuration associated with specified scope and sets the values of the maxConcurrentCalls, maxConcurrentSessions, and maxConcurrentInstances attributes on the element. You need to specify at least one of these parameters unless you use the –UseInherited flag.

When you use the parameter –UseInherited with this cmdlet, the cmdlet removes serviceThrottling element or <remove name=”serviceThrottling”> element from configuration file associated with the specified scope so that throttling settings are inherited from a higher scope.

Parameters

-ApplicationObject<ApplicationInfo>

The name of the ApplicationObject, which specifies that the cmdlet will operate on that application. This parameter is used to pipe the output of the Get-ASApplication cmdlet to a cmdlet containing the ApplicationObject parameter.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

-MaxConcurrentCalls<Int32>

Specifies the limit on number of messages that a service host can process at a time. If the number of calls being processed is equal to this value, any new calls are queued until one of the active calls completes. The allowed values for this parameter range from 0 to Int32.MaxValue. Setting this parameter to 0 is equivalent to setting it to Int32.MaxValue. The default value is 16 * number of processors in the computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-MaxConcurrentInstances<Int32>

Maximum number of service instances that can be active at any point of time in memory. The allowed values for this parameter range from 0 to Int32.MaxValue. Setting this value to 0 is equivalent to setting it to Int32.MaxValue. default value is Maximum Concurrent Calls + Maximum Concurrent Sessions.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-MaxConcurrentSessions<Int32>

Specifies the limit on number of sessions that a service host can accept. The service host will accept connections in excess of the limit, but only the channels below the limit are active (messages are read from the channel). The allowed values for this parameter range from 0 to Int32.MaxValue. Setting this value to 0 is equivalent to setting it to Int32.MaxValue. The default value is 100 * number of processors in the computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Root

The name of the root application, which specifies that the cmdlet will operate at that scope. If you use the Root parameter, do not use the SiteName, VirtualPath, or Uri parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-ServiceObject<ServiceInfo>

The name of the ServiceObject, which specifies that the cmdlet will operate on that service. This parameter is typically used to pipe the output of the Get-ASAppService cmdlet to a cmdlet containing the ServiceObject parameter.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

-SiteName<String>

The name of a Web site, as defined in the IIS Connections pane, which specifies that the cmdlet will operate at the scope of that site, or at the scope of an application, virtual directory, or service contained within that site. To the SiteName parameter, you can add the VirtualPath parameter that identifies an application, directory, or service included in the site.

For an application or virtual directory, the virtual path includes the name of the application, as defined in IIS. For a service, the virtual path includes the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. The VirtualPath parameter is not necessary for the site scope. The leading "/" character in the virtual path is optional. If you use the SiteName parameter, do not use the Uri parameter.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Uri<Uri>

A URI for an IIS site, application, virtual directory, or service, which specifies that the cmdlet will operate at that scope. If you use the Uri parameter, do not use the SiteName parameter or the SiteName and VirtualPath parameter set.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-UseInherited

Use this parameter to use inherited settings from the higher scope. When you use this parameter, the cmdlet removes any serviceThrottling behavior defined at the specified level. The cmdlet also removes any <remove name=”serviceThrottling”> element from the configuration file.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-VirtualPath<String>

The virtual path for an application, directory, or service, as defined in the IIS Manager Connections pane, which specifies that the cmdlet will operate at the application, virtual directory, or service. You must add the VirtualPath parameter to the SiteName parameter, using SiteName to identify the site that the application, directory, or service is contained within. The leading "/" character in the virtual path is optional.

For an application, the virtual path includes the name of the application, as defined in IIS. For a service, the virtual path includes the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. If you use the SiteName and VirtualName parameter set, do not use the Uri parameter.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • ApplicationInfo and ServiceInfo.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None.


Examples

Example 1

This command sets throttling settings at the root level.


Set-ASAppServiceThrottling –root –MaxConcurrentCalls 20 –MaxConcurrentInstances 30 –MaxConcurrentSessions 14

Example 2

This command sets throttling settings at the Web site level.


Set-ASAppServiceThrottling –SiteName “Default Web Site” –MaxConcurrentCalls 19 –MaxConcurrentInstances 29 –MaxConcurrentSessions 13

Example 2

These commands set throttling settings at the virtual application level.


Set-ASAppServiceThrottling –SiteName “Default Web Site” –VirtualPath “/SampleApp” –MaxConcurrentCalls 18 –MaxConcurrentInstances 28 –MaxConcurrentSessions 12Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Set-ASAppServiceThrottling –MaxConcurrentCalls 18 –MaxConcurrentInstances 28 –MaxConcurrentSessions 12

Example 4

These commands set throttling settings at the service level.


Set-ASAppServiceThrottling –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” –MaxConcurrentCalls 17 –MaxConcurrentInstances 27 –MaxConcurrentSessions 11Get-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Set-ASAppServiceThrottling –MaxConcurrentCalls 17 –MaxConcurrentInstances 27 –MaxConcurrentSessions 11

Example 5

These commands set throttling settings at the level determined by the using the URI.


Set-ASAppServiceThrottling –Uri http://localhost –MaxConcurrentCalls 20 –MaxConcurrentInstances 30 –MaxConcurrentSessions 14Set-ASAppServiceThrottling –Uri http://localhost/SampleService –MaxConcurrentCalls 20 –MaxConcurrentInstances 30 –MaxConcurrentSessions 14Set-ASAppServiceThrottling –Uri http://localhost/SampleService/SampleService.xamlx –MaxConcurrentCalls 20 –MaxConcurrentInstances 30 –MaxConcurrentSessions 14

Example 6

This command sets throttling settings at a service level to inherit from a higher level.


Set-ASAppServiceThrottling –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” –UseInheritedGet-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Set-ASAppServiceThrottling –UseInherited

Example 8

This command sets throttling settings for all services in an application.


Get-ASAppService –SiteName “Default Web Site” –VirtualPath “/SampleApp” | Set-ASAppServiceThrottling –MaxConcurrentCalls 15

Related topics

serviceThrottling element
Show: