vegeta icon indicating copy to clipboard operation
vegeta copied to clipboard

Limiting total number of requests

Open rsiatka opened this issue 1 year ago • 4 comments

Question

Hi, I can see that for vegeta the main condition to stop the simulation is time (-duration param). But is there an option to stop the simulation after reaching a certain number of sent requests? For example, tools such as: ab, oha, hey in addition to duration, have a parameter -n that is limiting number of requests to run - when this value is reached the simulation ends.

rsiatka avatar Feb 28 '24 17:02 rsiatka

@rsiatka what about the -rate option? You can limit like: -rate=100/s and do -duration=10s which should give you 1000 requests in total

noboruma avatar Mar 11 '24 06:03 noboruma

Thank you @noboruma. The solution with rate limit definitely helps. In my test scenario i'm trying to test application using closed workload model - sending 1M requests in shortest possible time using 1 connection only. I was hoping there is an option to detect max possible throughput automatically for such scenario but of course i can establish the value repeating the test several times for a different duration and rate. Thanks a lot.

rsiatka avatar Mar 12 '24 08:03 rsiatka

You're welcome @rsiatka You can only assess after trying what was the highest rate achievable. There are many factors that will impact your network connectivity (your NIC, the state of the network, the distance, and so on). So even if you ask for 1M RPS, the tool might not be able to provide you the requested rate depending on physical constraints.

To limit the unknowns, try to test on a private network and always record how many requests were successful.

noboruma avatar Mar 12 '24 09:03 noboruma

Yes @noboruma, totally agree. In order to simplify the tests and reduce the factors causing uncertainty, I have disabled the NIC and testing my service on localhost first, actually on 127.0.0.1 because vegeta, in the absence of a card, cannot resolve localhost on winows. Getting Get http://localhost:999: lookup localhost on [::1]:53: read udp [::1]:50813->[::1]:53: i/o timeout

rsiatka avatar Mar 12 '24 17:03 rsiatka