Search code examples
wcfwcf-binding

WCF Throttling with Multiple ServiceContracts


I have a WCF service with 14-15 Service contracts defined using netTcpBinding and no security or reliable sessions.

I have enabled Throttling as a behavior and have not defined an InstanceContextMode so I can assume it's a PerSession instancing. (I've read that even if I changed it to say PerCall it would ignore it since netTcpBinding is "sessionful", can someone confirm this?)

      <serviceThrottling
               maxConcurrentCalls="100"
               maxConcurrentSessions="300"
             />

My question really is, what should my settings be in this case for each service? and are there implications for performance and deadlocks with this many contracts defined in 1 running service on a server?

Thanks D


Solution

  • ServiceThrottling is a behaviour for a service and applies to a service.

    As such, you can define different such behaviours and apply different throttling to your services - perhaps prevent a DOS attack.

    General approach to Throttling is "If it aint't broke, don't fix it.". In most cases you do not need throttling. Throttling only helps if you have a shared resource (your website and services run on the same server) and you do not want your services to suffocate your website.

    Throttling is not gonna cause or help with deadlocks.