In the fourth installment in this series, "Build an SOA middleware application with Rational development tools," (see Resources) I talked about how you can use Web development tools to create the application. In the fifth installment, "Optimize Web Service applications with WebSphere Business Integration tools," (see Resources) I talked about how you can use business process tools to integrate and optimize the applications. I mentioned how reducing web requests along with execution time, access time, and bandwidth amount can optimize a Web services application.
In this installment, I cover how some problems of loading applications have had an impact on the way the Web services applications interact with one another. This includes an instance of a traffic bottleneck as a result of too many visitors sending too many requests during a particular range of time to a Web service application based on business processes. Then I talk about how you can benefit from some loading balancing techniques.
Keep in mind that Web requests are not the same thing as visitor requests. The number of Web requests depends on not only the number of visitor requests, but also the type and content of the visitor requests generating Web requests that have been optimized.
To get a better idea of the difference, take a look at this instance. If a visitor waits too long for an answer after sending a request through a Web service to a server, the visitor will go to another Web service or Web site for a faster response. The originating Web service will process a load of incoming visitor requests to generate and optimize Web requests for transmission to targeted Web services.
Slower response from the originating Web service can indicate that the targeted server is either busy or does not have enough room for the system to process more than one visitor request (multithreading). One way of handling this load problem is to balance the load between servers, so the visitors will not wait too long for their answers. This is known as a load balancing technique.
Balancing the load between servers is a better option than outsourcing Web services because it allows for increased server capacity, an improved site design, the ability to use RAID (Redundant Arrays of Inexpensive Disks) hardware, and it provides bandwidth on demand to handle expected peaks. They all cost more in the long run. With load balancing, you have a better chance of increasing performance and reliability, while reducing the bandwidth amount, execution time, and access time, given that a failover mechanism is included.
For these reasons, load balancing is the choice for the most companies when Web sites get quite a bit of traffic, particularly when they experience sluggish performance at peak times. These companies want faster responses that users demand in order to get more work done in less time.
You can route work to a different server host address in the domain name system or split the amount of work a server has to do between two or more servers. You need another server to determine intelligently which server to assign the work to. You need to combine these servers with failover and backup services in case a server fails, particularly when you distribute or cluster the servers over different geographic locations.
Think of load balancing servers as an analogy to four checkout counters in a supermarket. Let's take a look at how the supermarket would balance out the load between the counters.
Suppose you are in a long line at checkout counter 1 -- you can roughly guess how long it would take to move up in that line. If you find that the line moves slowly and see that another cashier is coming to checkout counter 4 to open it for business, you would quickly take your cart to that counter (see Figure 1).
Then another cashier opens checkout counter 3 and waves to the shopper who was in front of you in the first line before you moved over. The shopper, of course, moves to counter 3. Checkout counter 2 remains closed.
Figure 1. Load balancing shopping carts
Let's look at load balancing in another way. If you have a large cart with a month's worth of groceries for your family of ten, you might wish to distribute the items among multiple checkouts. This is particularly true when family members are not with you. You can reduce service time by breaking up the contents of the cart and distributing them across several freely-available checkout counters.
While this is not physically possible, you can do so with a load balancer that intelligently distributes the requests of an online shopping cart Web service application from a busy line to other freely available servers (see Figure 2). It is too expensive to run servers that are underutilized while others are struggling to keep up with demand for service.
Figure 2. Load balancing online cart requests
So how would you solve this problem? Run faster to the counter (increase the bandwidth)? Make the counter longer (increase server capacity)? Get someone else to shop for you (outsource)? None of these will work.
Ask yourself these questions:
- What kind of application is going to be load balanced?
- Is this a long-running kind in a globally distributed network?
- How many requests will a server or a cluster of servers receive over time?
- How much traffic and bandwidth amount will be expected at peak traffic times?
- How are the servers utilized for load balancing applications?
- How many visitors will be expected at various times?
- What is the maximum number of requests that a visitor can send?
Once you come up with solution alternatives, check or coordinate your solution alternatives with a network or system administrator for a mutual understanding. Then, develop a load balancing program using an algorithm, technique, or tool to redirect visitor and Web requests from a busy server to freely-available servers.
Some examples of load balancing techniques include the following:
- Simple routing
- DNS round robin
- Complex algorithms
- Intelligent routing
Since traffic needs to be prioritized in the real world, consider the last two techniques in developing a Web services application, since there are ever-expanding distributed networks of servers and visitors who demand fast responses. Since the first two techniques do not require prioritization of traffic, they are not worthy of a discussion on traffic bottlenecks.
When you use complex algorithms, requests are distributed based on, for instance, how well a server is performing, what kind of hardware the server has, and how customer priority is processed. This means the fastest servers get more loads of requests with the highest customer priority. Intelligent routing is based on the content of the request and how it can redirect traffic to another server at a different facility in the event of an originating server failure.
While you can accomplish load balancing using software, hardware, or both, you are better off with server-based software on a cluster of application servers. Server-based software is far cheaper than hardware-based dedicated servers. It is more expensive to upgrade hardware than its software counterpart.
Before you add server-based software to a network, check to see if the network is configured correctly and if the load balancer is flexible. The rationale for the flexibility is that, while the load balancer might be configured adequately for today's Web services application, it must have the capacity to expand for tomorrow's application.
IBM WebSphere Application Server is one example of server-based software that uses both complex algorithms and intelligent routing in load balancing and failover. Its load balancer has the capacity to expand for future requirements of a Web services application. You need to set up a cluster of servers for load balancing and test the failover mechanism (see Resources).
Another example is WebSphere Edge Server V2.0 for Multiplatform. It is designed to improve server selection, load optimization, and fault tolerance. It comes with Network Address Translation (NAT), Kernel-level Content Based routing (CSR) support, and the WebSphere Edge Server Consultant for Cisco CSS switches (see Resources).
Load balancing Web services applications requires planning ahead of time to determine how the loads can be balanced between servers at peak traffic times. Communicate with a team of system administrators on the issues of what load balancing techniques should be used in designing Web services.
You will find that resolving the issues makes your job of creating load balancing Web services applications much easier. You can develop and load balance Web services based on business processes within and across SOAs. The administrators will find that resolving the issues makes their job of load balancing Web services application much easier. They can determine which load balancing approaches to use and how many applications can be load balanced in a SOA.
Learn
- Get information on how to work with Web services in enterprise-wide SOAs from the other installments in this series:
- "Close enterprise system gaps with multiple SOAs" (developerWorks, February 2005)
- "Maximize external Web servies interoperability" (developerWorks, February 2005)
- "Consolidate your SOAs as a three-dimensional integration hub to improve speed and reliability" (developerWorks, March 2005)
- "Build SOA middleware application with Rational development tools" (developerWorks, May 2005)
- "Optimize Web Service applications with WebSphere Business Integration tools" (developerWorks, July 2005)
- Get information on service-level agreements from Judith's series, "Use SLAs in a Web services context".
- These resources will provide background if you're interested in pursuing this topic further:
- Read Judith M. Myerson's The Complete Book of Middleware, which focuses on the essential principles and priorities of system design and emphasizes the new requirements brought forward by the rise of e-commerce and distributed integrated systems.
- Get the business insight and the technical know-how to ensure successful systems integration by reading Enterprise Systems Integration, Second Edition.
- Learn more about WebSphere Edge Server's caching, security, content distribution and other features.
- Get details on load balancing and failover mechanism in IBM WebSphere Application Server.
Get products and technologies
- Get a trial version of WebSphere Application Server V6.




