Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

num-requests bug #512

Closed
gathanase opened this issue Jan 9, 2017 · 13 comments
Closed

num-requests bug #512

gathanase opened this issue Jan 9, 2017 · 13 comments

Comments

@gathanase
Copy link

gathanase commented Jan 9, 2017

locust behaves strangely sometimes when using "num-requests". For some reason the test does not stop after num-request is reached, but it starts again from the beginning (with fewer clients).
My guess is that all clients are not created when the num-request is reached.

"locust --no-web --hatch-rate=10 --clients=80 --num-requests=200 --host=myhost MyUsecase"


 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 Total                                                              0     0(0.00%)                                       0.00

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                       14     0(0.00%)      52      20      98  |      58    0.00
 GET /status                                                       15     0(0.00%)      51       3     109  |      49    0.00
 Total                                                             29     0(0.00%)                                       0.00

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                       48     0(0.00%)      52      20     158  |      49    6.00
 GET /status                                                       50     0(0.00%)      27       3     109  |       5    7.50
 Total                                                             98     0(0.00%)                                      13.50

 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                       86     0(0.00%)      52      20     158  |      37    9.00
 GET /status                                                      114     0(0.00%)      20       2     109  |       5    9.67
 Total                                                            200     0(0.00%)                                      18.67
=> it should end there
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                       86     0(0.00%)      52      20     158  |      37    9.00
 GET /status                                                      114     0(0.00%)      20       2     109  |       5    9.67
 Total                                                            200     0(0.00%)                                      18.67
=> or it should end there
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                        1     0(0.00%)     100     100     100  |     100    0.00
 GET /status                                                        1     0(0.00%)      10      10      10  |      10    0.00
 Total                                                              2     0(0.00%)                                       0.00
=> it restarts...
 Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
 GET /health                                                        2     0(0.00%)      65      30     100  |      30    1.00
 GET /status                                                        2     0(0.00%)      10      10      11  |      10    0.00
 Total                                                              4     0(0.00%)                                       1.00
@gathanase
Copy link
Author

This happens with "Locust 0.7.5"
All clients perform 1 request / second

@heyman
Copy link
Member

heyman commented Jan 9, 2017

My guess is that it somehow happens because the 200 requests are reached before Locust has finished spawning users (since it takes 8 seconds to spawn 80 users with a hatch rate of 10).

I'm leaning towards removing the --num-requests feature all together, and instead replacing it with the ability to specify a time limit.

@cgoldberg
Copy link
Member

+1 for time limit

@seangerhardt-wf
Copy link

@heyman Although you wouldn't be able to configure it at the individual locust level, couldn't you just prefix the command with timeout on Linux or gtimeout on mac and achieve what you want? I guess this would only currently work with --no-web as well.

@heyman
Copy link
Member

heyman commented Mar 23, 2017

@seangerhardt-wf Yeah, I think it would only make sense to have it work with --no-web. I guess setting a timeout on the OS level could work, but it's probably a common enough use case to warrant it's own option in Locust.

@seangerhardt-wf
Copy link

I guess I personally prefer the OS approach since it will mean less code and make locust less prone to bugs.

@Prabhath337
Copy link

@heyman - I am running a test with number of clients=100 hatch rate=10 --no-web turned on. My test runs for a longer duration when --num-request is not provided
Is there any relation between --num-request and number of clients when running in --no-web

It would be really great if i get some information on this as i am unable to get it from documentation.

@heyman
Copy link
Member

heyman commented Sep 19, 2017

"Fixed" by #656

@heyman heyman closed this as completed Sep 19, 2017
@ghost
Copy link

ghost commented Sep 17, 2019

@heyman : I am using Locust 0.11 version. I am using no web-ui with below command because I want to stop the tests after specific number of requests.

locust -f locustfile.py --no-web --clients=5 --hatch-rate=1 --num-request=5

but it is giving me error : " locust: error: no such option: --num-request"

It would be helpful if you help me in following scenario "how to stop the test after specific number of requests reached"

@aldenpeterson-wf
Copy link
Contributor

@nityasantoshi that was removed here - #656

@ghost
Copy link

ghost commented Sep 17, 2019

@aldenpeterson-wf Is there any way to stop the execution after specific number of requests are done?

@vignesh-18
Copy link

Is there any way to stop the execution after a specific number of requests are done?

@heyman
Copy link
Member

heyman commented Feb 6, 2020

Is there any way to stop the execution after a specific number of requests are done?

No. For more info on the rationale:
#656 (comment)
#656 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants