During a load test, VUs are distributed between load agents and test objects (test cases and test case groups).

Rule of thumb

Each load agent will execute the test independently during a distributed load test. The VUs are distributed in the following order:

  1. Before the test starts, the controller allocates the VUs between the load agents according to their mix weight.
  2. During the test, each load agent will distribute its own VUs between test objects according to each test object's mix weight

    Controller-only test

    Step 1 is skipped during a controller-only test where only the local agent runs the test.

Mix Weights

An item's mix weight is the relative frequency the item gets picked (in round-robin order) compared to other items in the mix. Consider the example of 3 test cases and their mix weights.

Test CaseMix Weight
View Store5
Search Store2
Place Order6
Return Item4
Total15

In this example, for every 15 VUs, 5 VUs will execute View Store, 2 will execute Search Store, 6 will execute Place Order, and 2 will execute Return Item. 

To find the percentage of VUs that will execute a test case, divide the mix weight or the item by the total weight. So View Store will be executed by 5/15 = 33.33%

Disable item

To disable an item from being picked, set its mix weight to 0.

Rounding

If the total mix weight is not a factor of the total VUs, the VU distribution is rounded unpredictably. Therefore, it is recommended to make the total mix weight a factor of the total VUs.

Determining mix weights

Let's take a test that will have a maximum load of 1000 VUs between 4 test cases running across 3 load agents (named East, West, and Local). Below is an example of desired VU distributions between the test cases.


Test CaseDesired VUsPercent
View Store35035
Search Store47547.5
Place Order12512.5
Return Item505


Click the Configure VU distribution > By Load Agent - TC... button in the Mix Weights control to bring up the VU configuration dialog.


Distribute VUs between load agents

According to the rule of thumb, first, the 1000 VUs are distributed between load agents. Select the All Load Agents node and modify the Mix Weight column on the left in the dialog. The VU Distribution column shows the actual number of VUs that will be executed on the agent. 

Load Agent Mix WeightPercentNumber of VUs
East50050500
West30030300
Local20020200

Tip

When the sum of the mix weights equals the sum of VUs to distribute, then the individual mix weights equal the individual VU distribution.

 




Distribute VUs between test cases

Now that the VUs have been distributed between the load agents, the test case distribution can be configured on each agent individually.


East (500 VUs)West (300 VUs)Local (200 VUs)
Test CaseAgent Mix WeightPercentNumber of VUs
View Store15030150
Search Store30060300
Place Order25525
Return Item25525
TOTAL

500 VUs
Test CaseAgent Mix WeightPercentNumber of VUs
View Store15050150
Search Store15050150
Place Order000
Return Item000
TOTAL

300 VUs
Test CaseAgent Mix WeightPercentNumber of VUs
View Store502550
Search Store2512.525
Place Order10050100
Return Item2512.525
TOTAL

200 VUs


Select an agent node to modify the test case mix weights


East (500 VUs)West (300 VUs)Local (200 VUs)


Note

In the above example, the test cases Place Order and Return Item will not run on the West since their mix weights are 0 for that load agent.

  • No labels