Share via


ServiceThrottlingBehavior.MaxConcurrentCalls 속성

정의

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

public:
 property int MaxConcurrentCalls { int get(); void set(int value); };
public int MaxConcurrentCalls { get; set; }
member this.MaxConcurrentCalls : int with get, set
Public Property MaxConcurrentCalls As Integer

속성 값

서비스의 활성 메시지에 대한 최대 개수입니다. 기본값은 16 x 프로세서 수입니다.

예제

다음 코드 예제에서는 애플리케이션 구성 파일에서 ServiceThrottlingBehavior를 사용하여 MaxConcurrentSessions, MaxConcurrentCallsMaxConcurrentInstances 속성을 1로 설정하는 예를 보여 줍니다. 실제 경험을 통해 특정 애플리케이션에 대한 최적의 설정을 결정하도록 합니다.

<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>

설명

MaxConcurrentCalls 속성은 ServiceHost 개체에서 동시에 처리하는 최대 메시지 수를 지정합니다. 각 채널 메시지의 값에 계산 되지 않는 보류 중 하나일 수 있습니다 MaxConcurrentCalls Windows Communication Foundation (WCF) 처리를 시작할 때까지 합니다.

애플리케이션 구성 파일에서 serviceThrottling> 요소를 사용하여< 이 특성의 값을 설정할 수도 있습니다.

경고

MaxConcurrentCalls 큐에 대기 중인된 시나리오에서 SQL 연결 풀 크기 보다 작은 값으로 설정 되어야 합니다.

적용 대상