Load balancing vusers without a load balancer
Recently I ran a test at a company which had a performance test environment with multiple web servers, but no load balancer. To spread my virtual users evenly across the web servers, I made a simple modification to my script.
First, I created a file-based parameter containing my web server names.

Next, I parameterised the server name part of the URLs in my web_url() and web_submit_data() function calls.
1 2 3 4 5 6 7 8 9 | web_url("Login", "URL=http://{ServerName}/login.do", "TargetFrame=", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t1.inf", "Mode=HTML", LAST); |
So, when the script ran, the virtual user would would choose a web server at random on every iteration.
…and that was it. I didn’t say it was going to be hard. :)
Of course, my Test Summary Report was very clear that one of the limitations of the Performance Test cycle had been that there was no load balancer in the test environment, so the stability and performance characteristics of this component in the Production environment could not be predicted.
Related posts:
- Testing Web Services With a Standard Web Vuser It is possible to test web services using the standard...
- The “is it done yet” loop Occasionally you will find that you must write some code...
- What’s New in LoadRunner 9.50? LoadRunner 9.5 was released today and, as mentioned by the...
- LoadRunner in Windows 7 Windows 7 has finally been released, and I’ve had the...
- Changing LoadRunner/VuGen log options at runtime LoadRunner has a whole bunch of logging options. These can...
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
January 13th, 2009 at 4:48 pm
Kim from Performance Testing @ the Frontline has written a similar article with an alternative way of solving this load balancing problem.
April 17th, 2009 at 1:13 am
A alternative solution uses the vuser id modulo the number of hosts.