Load balancing is a technique to spread work between multiple back-end servers in order to obtain optimal resource utilization, throughput and response times. Requests are directed to the load balancing hardware or software and then forwarded to the appropriate server.
Load Balancing by IP Address
A variety of algorithms are used by load balancers to determine which back-end server to send a request to. One such method is load balancing by IP address. With this method requests are balanced across the back-end servers by the IP address of the machine from which the request originates.
An injector machine will typically have a single IP address and so all virtual users (VUs) generated from the injector will posses this same IP address. This will cause the load balancer to forward all requests from the injector to the same back-end server.
There are two strategies that can be employed to overcome this problem.
Strategy 1: Multiple Injectors
One way of running a performance test against a system under test that utilizes IP load balancing is to use multiple load injectors. If load balancing occurs across four back-end servers then the solution is to match this with four injectors; resulting in four source IP addresses. This will ensure that the load is distributed amongst all four back-end servers. All requests from each injector will be directed to one of the servers.
If enough injectors cannot be sourced in order to pursue Strategy 1 then it may be appropriate to spoof the IP addresses of the VUs within the test. IP spoofing is a method of assigning an IP address to an individual VU.
For IP spoofing:
- You will need a range of unused IP addresses from the Network Administrator. These are the IP addresses that will be assigned to the VUs. Again, if there are four back-end servers participating in load balancing, the minimum number of IP addresses required for the virtual user population is also four.
- The network routing must also be capable of handling a PC with multiple IP addresses. Typically, the environment should be capable of working with static, rather than dynamic, IP addresses. The network administrator should be able to advise you on this.
To configure a Windows Injector for multiple local IP addresses, do the following:
- Open Network Connections.
- Right-click the required network connection and select Properties.
- Under the General tab select Internet Protocol (TCP/IP) and then Properties.
- Select Use the following IP address.
- Select Advanced.
- Now assign the IP addresses to your network card under the IP Settings tab.
- You must also set the address of the DNS server on your network under the DNS tab.