scarpacci
scarpacci

Reputation: 9194

WCF Throttle Settings

I have been working on a proof of concept using WCF and MSMQ. I have been playing around with the throttle settings using the defaults This Article and also adding my own settings to the config file. I have 2 Quad Core Xeon CPUs running this application. No matter what settings I apply it always only appears to grab 8 messages at a time (Which matches my processing cores). I want each of the messages to be handled in a single transaction so that could be part of the issue...not sure. I jsut assumed it would handle a lot more messages concurrently than it is.

Service Behavior:

   [ServiceBehavior(UseSynchronizationContext = true,
                     ReleaseServiceInstanceOnTransactionComplete=true,
                     ConcurrencyMode = ConcurrencyMode.Single,
                     InstanceContextMode = InstanceContextMode.PerCall)]

Endpoint Behavior:

  <endpointBehaviors>
    <behavior name="endpointBehavior">
      <transactedBatching maxBatchSize="1" />
    </behavior>
  </endpointBehaviors>

My own Service Throttling:

<serviceThrottling maxConcurrentCalls="128" maxConcurrentSessions="800" />

Am I overlooking something? Maybe I just don't fully understand the default / custom throttle settings (Likely).

EDIT

I have modified the ConcurrencyMode (Changed to Multiple) along with the ReleaseServiceInstanceOnTransactionComplete setting. Changing to Multiple didn't seem to change anything?

EDIT Is it maybe the TransactionBatch setting? I have that set to one...?

Thanks,

S

Upvotes: 6

Views: 4036

Answers (2)

felickz
felickz

Reputation: 4461

Since you are running PerCall instancing you should increase MaxConcurrentInstances. Even in .Net 4 the default is 26. In 4.5 "The default is the sum of the default value of MaxConcurrentSessions and the default value of MaxConcurrentCalls.."

BTW... WCF will call into your instance on multiple threads unless you are using InstanceContextMode.PerCall. InstanceContextMode.PerCall+Any ConcurrencyMode = N concurrent invocations of the method on N service instances, where N is determined by the service throttle Reference

Upvotes: 0

scarpacci
scarpacci

Reputation: 9194

I found a blog that pointed me to some good documentation on WCF throttling / performance. I added some more meta output to my processing application and was able to get the performance I was looking for. By adding more information to my process (ManagedThreadID, etc) I could see I was getting a lot more throughput than I had originally assumed. I also found some of the tips in the blog below to be helpful.

Blog

Thanks,

S

Upvotes: 4

Related Questions