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
Delay at startup and high cpu usage on Windows in Python 3.12 #2555
Comments
Can you reproduce this with a locustfile that doesnt use any of your dependencies? If possible, can you downgrade locust and find the latest version that doesnt have this issue? |
Also, what if you use tasks directly on the User instead of using a separate TaskSet? |
Just tested it with only locust imported and I was able to reproduce it. 😕 Could it maybe be a updated Python version or Windows Update? Edit:
This also didn't help |
Hmm… very strange. Can you try running just a plain locustfile with none of your ”special” stuff? And maybe try changing the weight from 300 to 1? |
Same results. I used the basic example from the docs and changed the url: from locust import HttpUser, task
class HelloWorldUser(HttpUser):
@task
def hello_world(self):
self.client.get("/api/v1/health")
|
By the way, the same happens when I run it headless:
|
Wow. That is really weird. I’ll have to try it on my windows machine some time. I dont expect I’ll be able to reproduce it though :-/ |
Thanks in advance. Your project is awesome. 👍 |
Sorry for not getting back to you sooner. I tried the simplified script on my machine with no issues.
|
I also tried with the web-ui. It is very noisy when I use ctrl-c to exit, but other than that I had no issues (with the simplified test). |
After continue working with locust I noticed that this issue seems to occur only with targets over https. |
Is your server maybe not responding? https works fine for me as well. |
wait, now I WAS able to reproduce with https. Probably some exception is being triggered and then there is an infinite loop. I will investigate. |
For now, you can try using FastHttpUser as a workaround. |
The |
Huh. there seems to be a regression in OpenSSL OpenSSL 3.0.13/Python 3.12 I was able to reproduce with 3.12 but not with 3.10. |
Interesting. I hope there will be a fix anytime soon. |
I'm looking into it. Might be possible to just set insecure option somewhere. |
A really awkward workaround is letting your users share a connection pool. That seems to avoid the issue....
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Any news on this one other than the workaround? |
There’s an open PR for requests that could fix it for HttpUser: (maybe something similar could be implemented for geventhttpclient as well) Either way, this cant really be fixed in locust as it is an underlying issue. |
If you encounter this issue, then install the latest and greatest |
Prerequisites
Description
When I start a test with let's say 50 peak users and a spawn rate of 10, locust won't run any requests for 5 seconds and the starts them all at once.
Same happens when I increase or decrease the peak number while a test is running: The test stops completely
Weird is also, that it complains about high CPU usage, which is not the case at all (CPU is a Ryzen 7 7800X3D).
This issue only happens since I updated locust to the latest version a while ago. Before that the user ramp-up/-down ran butter smooth.
I use locust via the Web UI.
This is what it looks like in the UI with the weird startup and rampup (negative spike at the end of the graph)
Command line
locust -f .\tests\load_test.py
Locustfile contents
Python version
3.12
Locust version
2.20.1
Operating system
Windows 11
The text was updated successfully, but these errors were encountered: