Load Balancing and Failover

A very important consideration for scalable enterprise services is distribution, load-balancing, and session failover across multiple server machines. A single host process is not likely to handle more than 350 to 500 requests per second on average, thus the need for multiple processes and eventually multiple server machines to support the load. In a simple case where sessions are not involved (BasicHttpBinding or WSHttpBinding without reliable session or secure session), the distribution of work across server machines can be handled with load balancing techniques using hardware-level routing or Windows Network Load Balancing (NLB), for example.

Without sessions, it doesn’t matter which server machine processes each request; the load can be distributed based on round-robin system, or more intelligent algorithms that detect the most available server. Figure 5-19 illustrates the same proxy making subsequent calls across multiple server machines.

PerCall services do not require server affinity

Figure 5-19. PerCall services do not require server affinity

The minute that sessions are introduced, it is important that requests are forwarded to the server maintaining the session. This requirement applies to any type of session, including application sessions, transport sessions, reliable sessions, and secure sessions. In the case of application sessions, the same service object must be allocated, as shown in

Get Learning WCF now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.