ServiceThrottle 클래스

정의

서비스의 처리량을 제어하여 가용성과 성능을 최적화합니다.

public ref class ServiceThrottle sealed
public sealed class ServiceThrottle
type ServiceThrottle = class
Public NotInheritable Class ServiceThrottle
상속
ServiceThrottle

예제

다음 코드 예제에서는 애플리케이션 구성 파일에서 ServiceThrottle를 참조하여 ServiceThrottlingBehavior을 사용하는 일반적인 방법을 보여 줍니다. 이 경우 지정되는 값은 한 InstanceContext에 대한 하나의 연결에서 한 번에 최대 하나의 메시지 처리만 설정합니다. 실제 사용량은 경험을 통해 결정해야 합니다.

<configuration>
  <appSettings>
    <!-- use appSetting to configure base address provided by host -->
    <add key="baseAddress" value="http://localhost:8080/ServiceMetadata" />
  </appSettings>
  <system.serviceModel>
    <services>
      <service 
        name="Microsoft.WCF.Documentation.SampleService"
        behaviorConfiguration="Throttled" >
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/SampleService"/>
          </baseAddresses>
        </host>
        <endpoint
          address=""
          binding="wsHttpBinding"
          contract="Microsoft.WCF.Documentation.ISampleService"
         />
        <endpoint
          address="mex"
          binding="mexHttpBinding"
          contract="IMetadataExchange"
         />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior  name="Throttled">
          <serviceThrottling 
            maxConcurrentCalls="1" 
            maxConcurrentSessions="1" 
            maxConcurrentInstances="1"
          />
          <serviceMetadata 
            httpGetEnabled="true" 
            httpGetUrl=""
          />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

설명

서비스의 성능 특성을 조정하려면 ServiceThrottle을 사용합니다. 서비스에 대한 ServiceThrottle을 구성하는 가장 쉬운 방법은 특히, 애플리케이션 구성 파일에서 ServiceThrottlingBehavior를 사용하는 것입니다.

MaxConcurrentCalls 속성은 ServiceHost 개체의 모든 디스패처 개체에서 동시에 처리할 수 있는 최대 메시지 수를 지정합니다.

MaxConcurrentInstances 속성은 서비스의 최대 InstanceContext 개체 수를 지정합니다.

MaxConcurrentSessions 속성은 ServiceHost에서 수락할 수 있는 최대 세션 수를 지정합니다.

참고

첫 번째 호출, InstanceContext 또는 세션이 대기 목록의 큐에 대기 중일 때 추적이 기록됩니다. 첫 번째 추적이 경고로 기록됩니다.

속성

MaxConcurrentCalls

ServiceHost의 모든 디스패처 개체에서 동시에 처리하는 최대 메시지 수를 가져오거나 설정합니다.

MaxConcurrentInstances

한 번에 실행할 수 있는 최대 서비스 개체 수를 가져오거나 설정합니다.

MaxConcurrentSessions

ServiceHost 개체가 한 번에 수락할 수 있는 최대 세션 수를 지정하는 값을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상