0

I am playing around LocustIO. I have a single self.client.get() task with my min_wait and max_wait were set to be 1 millisecond each.

class App_User(HttpLocust):  
    ... 
    min_wait = 1  
    max_wait = 1  

I was using logging to see the response. I am expecting in console that timestamps of the task logs will be within the same second given a max_wait of 1 millisecond but it seems that the task runs every 1 second still.

Is it wrong to expect a 1000 GET responses within a 1 second load test period given 1 millisecond task wait; 1 simulated user as well?

Dee
  • 401
  • 3
  • 9
  • 22

2 Answers2

3

Is it wrong to expect a 1000 GET responses within a 1 second load test period given 1 millisecond task wait; 1 simulated user as well?

Those values only apply to the time between a full task.

For example, if your GET request takes 5 seconds, for each Locust you will see something like:

  • 0.000s -- request 1 started
  • 5.000s -- request 1 completed, wait for 1 ms
  • 5.001s -- request 2 started
  • 10.001 -- request 2 completed, wait for 1 ms
  • 10.002 -- request 3 started

etc.

This is because the wait time only happens between requests. It is not saying "run ever 1 ms" but rather "wait 1 ms between every task after they complete."

user372895986472
  • 1,084
  • 7
  • 4
1

1ms is the wait time between 2 requests. So it's likely that your server takes 1s to respond. If you want to have more requests per seconds, you should add more "App_User".

Also, your test machine may not be able to shoot requests at that high rate, my poor PC can only do less than 70. At this stage, you need a locust swarm.

Finally, one important thing to notice is that Locust is not designed to have a fixed RPS, its goal is to simulate user behavior.

Siyu
  • 11,187
  • 4
  • 43
  • 55
  • Are you sure in asker's test scenario, the server takes 1 seconds to reponse to a request? Locusts beahavior really confused me, so I posted a question like this , check this out https://stackoverflow.com/questions/53753703/reqs-sec-not-correct-when-load-testing-with-python-locust. In my testing, you could find my server respond very quick from statistics of avrage response time. But still TPS is much lower than I expected. – Jcyrss Dec 14 '18 at 06:10
  • Max rps from a single instance is ~600 for me, at this point it gets capped at 100% of single core. So you can actually run multiple locusts on a single machine with swarm mechanism. – Imaskar Jan 07 '20 at 17:02