Summary
In this chapter, you learned about instancing modes, concurrency modes and
synchronization, as well as throttling behaviors for WCF services. You learned how to apply
PerCall, PerSession,
and Single instancing modes and the resulting effect on
service object allocation; the implications of application sessions, transport sessions,
reliable sessions, and secure sessions where exceptions and faults are concerned; how to
throttle access for concurrent requests, service instances, and session allocation; and the
impact of sessions on load balancing and failover scenarios. Some general recommendations
you can take away from this chapter are:
Use
PerCallservices whenever possible.Avoid
PerSessionconcurrency mode for large-scale deployments.When
PerSessionservices are required, try to useSingleconcurrency mode for synchronization. Require session-capable bindings in the service contract.Avoid
Singleconcurrency mode for large-scale server deployments.When
Singleconcurrency mode is required and clients are multithreaded, apply custom synchronization only if necessary to increase throughput.Always check the proxy state to ensure the server channel has not faulted.
Try to throw
FaultExceptionderivatives from services to avoid unnecessarily faulting the server channel.Set throttling behaviors to yield as close to 300 requests per second for a single host process as possible and to ensure callers are able to acquire new sessions.
Pay close attention to performance counters watching ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access