I have a test scenario in which my testdata is stored in a database and based on the coloumn time_to_send i will be sending the request. I am using function setTimeout() to simulate this behavior and when the timeout happens it will then send a POST request. But in my table there are 50000 users and when i use shared iterations it can randomly distribute the data instead of distruting it “time_to_send” coloumn ascending. As a result i cant assign multiple tests to the same VU because its possible that a record with time_to_send 1hr is scheduled before time_to_send 1min. As a result i am creating number of VUs to the same amount as the number of records in the table. But then to rampup the VUs it takes like 50 min. So i was wondering if i can combine the shared_iterations and rampup to quickly start the vus and shared iterations then assigns each record to 1 vu.
Hi @shaadikols, welcome to the community forum and sorry for the slow reply.
If you are going to be making 50k requests in total over a big enough period, I will expect you can probably split the input data between 10-20 VUs and use setTimeout
+ http.asyncRequest
to make it work.
I would argue having 50k VUs that wil ever only do 1 request isn’t a very good way.
Ideally you will be able to have the input data ordered and not have to have 50k setTimeout calls at the beginning.
If the time between the request is regular I would recommend ignoring time_to_send
column but making the rate with ramping-arrival-rate (or constant if not changing) executor.
You should probably look at k6/execution to see different variables that will help you distribute the input data between VUs . There are a bunch of examples there.
Hope this helps you !