mark
June 6, 2019, 3:03pm
2
@sandyuce Here is a related topic that should help. In short you need to generate a unique number per VU, you should use __VU and __ITER together to do this.
This answer is deprecated. Saved for posterity.
As mentioned above, in order to prevent collisions between VUs accessing data from an external source, we need to calculate a unique number per VU iteration. Luckily, we have a few pieces of data we can use to calculate this. k6 provides the ID of VUs per load generator(k6 instance) as well as an iteration for each VU.
__VU is the ID of a VU. It is 1 based and assigned sequentially as VUs ramp up. Every VU on a load generator will have a unique V…