Test Load Balancing in JMeter Test Load Balancing in JMeter kubernetes kubernetes

Test Load Balancing in JMeter


The process of identifying the first bottleneck is called Stress Testing and yes, you need to start with 1 thread (virtual user) and increase the load until response time starts exceeding acceptable threshold or errors start occurring (whatever comes the first)

If you need to check load balancing capabilities, i.e. your request should return the relevant pod ID - you can use JSR223 PostProcessor to extract the pod ID from the response and amend HTTP Request sampler label with what you get from the response, the code would be something like:

prev.setSampleLabel(prev.getSampleLabel() + ' - ' + prev.getResponseDataAsString())

Demo:

enter image description here

In the above example prev stands for the previous SampleResult, see the JavaDoc for all available functions/properties and Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information on this and other JMeter API shorthands exposed to JSR223 Test Elements