Tuesday, August 24, 2010

Load Balancing and Scaling Your WCF Services

WCF Design and Configuration Recommendations for Distributed Environments

Measurement

Target SLA Goals

Performance

<>

Throughput

150-500 requests/second on a single server with 4 CPU depending on the overhead of each request

Scalability

Ability to add new servers with minimal configuration effort

Figure 1: SLA goals for performance, throughput, and scalability.


Figure 2: Load balancing without sessions.


Figure 3: Load balancing and application sessions.


Figure 4: Load balancing and durable services.


Figure 5: Load balancing and transport sessions.


Download the samples for this article at http://www.dasblonde.net/downloads/aspprodec08.zip.

Developers should consider the impact of load balancing and scalability in their service design by doing the following:

  • Disable HTTP Keep-Alive to remove server affinity for simple HTTP bindings.
  • Make services durable if application sessions are supported.
  • Cache proxies in multithreaded client-server scenarios and silently recreate proxies as needed when channels are faulted.
  • Cache the channel factory if possible for server-server scenarios.
  • Allow multiple threads access to PerCall services to support multithreaded clients.
  • Try to keep service hops to two or three per request thread and benchmark as hops are added to verify good enough performance can be achieved.
IT should consider the following:
  • Configure load balancers for sticky IP or sticky sessions as needed where sessions are supported.
  • Ensure throttling configuration is sufficient for application throughput.
  • Monitor performance counters to ensure that performance and throughput results are meeting SLA requirements, adjusting configurations as necessary.



Load Balancing and Scaling Your WCF Services

0 comments: