Search code examples
jmeterperformance-testingload-testingamazon-elb

Elastic Load Balancer and jmeter http(s) test script recorder


I have an elastic load balancer(ELB) which distributes the load to two web servers. I have two more servers for the database with active-passive configuration. I have used JMeter's test script recorder for recording browser activity. For this, I have used http://elb-address/demo.html in the Firefox address box. Unfortunately, my recording controller would only take one web server.

I want to re-run this with multiple thread groups. But, when I specify http://elb-address/demo.html it will only use one web server IP address.

enter image description here

How to instruct the load balancer to use multiple web servers. Please advise how to proceed.


Solution

  • You can use Search and Replace feature to replace all occurrences of the web-server-ip-address with elb-address in the recorded HTTP Request samplers

    JMeter Search and Replace

    Also make sure to add DNS Cache Manager to your Test Plan as JMeter might cache DNS requests so you will be hitting only one node behind the load balancer instead of distributing the load across backend nodes.