Vampavi
Vampavi

Reputation: 322

Load balancing in Jmeter

I want to conduct a HTTP load test.

I've 8 different managed servers(with different ports and same IP), and I want to load balance my requests(5 requests per sec). How should I configure it in JMeter?

Upvotes: 1

Views: 2456

Answers (3)

Dmitri T
Dmitri T

Reputation: 168082

In general I don't think that sending requests to different servers is something that real users will do so most probably you will have (or already have) a load balancer (or several for failover reasons) in front of your system acting as a single entry and exit point.

So well-behaved JMeter test should target the load balancer, not single backend host, this way you will be able to test failover, resilience, load balancing algorithms, etc.

  1. Configure your JMeter test to hit the load balancer instead of individual servers
  2. Make sure you have DNS Cache Manager added to your Test Plan
  3. If needed you can limit JMeter's throughput via Constant Throughput Timer

Upvotes: 0

Ori Marko
Ori Marko

Reputation: 58772

Another option, if it's 1 request you can also split it to 8 requests with different servers and put requests under Interleave Controller.

Each request will send to different server.

You can check the Interleave across threads checkbox for supporting threads.

If checked, the interleave controller will alternate among each of its children controllers for each loop iteration but across all threads

For timing use @UBIK LOAD PACK suggestion.

Upvotes: 1

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34536

In HTTP Request, use a Variable for your port :

${port}

enter image description here

Use a CSV Data Set that will use a CSV file containing 1 row per port:

enter image description here

To have 5 requests per sec, add a Constant Throughput Timer and set its Target Throughput:

enter image description here

Alternatively you might want to use this 3rd party plugin :

Upvotes: 1

Related Questions