1

My company owns a server with 24 cores and a lot a RAM inside. The OS is Windows 2008 R2 SP1. I deployed on this server a WCF application, hosted in IIS. On the same server I installed a multithreaded client which calls one of the WCF service, as often as possible. I encountered a bottleneck : all the cores on the server are used, but at a very low level, so the CPU consumption doesn't exceed 10 %. My WCF service is configured like this :

  <system.serviceModel>
<services>
  <service behaviorConfiguration="myBehavior" name="...">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="myBinding" bindingNamespace="..." contract="..."/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="myBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" />
    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <netTcpBinding>
    <binding name="myBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" portSharingEnabled="false" transactionFlow="false" listenBacklog="2147483647">
      <security mode="None">
        <message clientCredentialType="None"/>
        <transport protectionLevel="None" clientCredentialType="None"/>
      </security>
      <reliableSession enabled="false"/>
      <readerQuotas maxDepth="64" maxStringContentLength="204800" maxArrayLength="204800" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
    </binding>
  </netTcpBinding>
</bindings>

My service has also the following attributes : InstanceContextMode.Single and ConcurrencyMode.Multiple. Did anyone encounter a similar problem ? I searched the solution for days, but I didn't find it yet :(

Thank you in advance !

3
  • What makes you think that the CPU usage is the constraint?
    – razlebe
    Nov 18, 2011 at 17:11
  • On a server with "only" eight cores, I get almost the same performance as on the server I mentioned on my post...
    – schglurps
    Nov 18, 2011 at 17:33
  • @schglurps if you get the same perf on 8 vs 24, that pretty much proves it is unrelated to CPU Nov 18, 2011 at 18:34

1 Answer 1

4

I'm not sure how you're measuring the performance bottleneck but no matter how many client calls you generate, the service will only handle 200 calls at a time. The netTcpBinding is uses sessions so the throttle there is the maxConcurrentSessions="200" setting. You've configured the service as a multi-threaded singleton which is limited to 200 simultaneous calls by the maxConcurrentCalls="200" setting. The CPU load will also depend on how much work is performed during each call and whether it is IO bound or not. Review the serviceThrottling element documentation and try increasing both settings to see if your throughput improves.

If your sevice implementation allows, I would recommend you try configuring the service with InstanceContextMode.PerSession and ConcurrencyMode.Single to compare throughput with your current configuration. IIS 7x hosts WCF services using the Windows Process Activation Service (WAS). WAS is designed to handle concurrency. A singleton configuration negates the value of using WAS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.