-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
OpenSSL 3 performance regression on Windows #109386
Comments
Can you reproduce this without using requests? Maybe with urllib.request? |
It did not occur to me because nothing else was changed when I upgraded Python version. Does this mean this is Instead of calling s = requests.Session()
while True:
res = s.get("https://httpbin.org/get")
time.sleep(3) |
Repro without
|
@neonene : on which version of python and which platform did you run this? |
The performance hit from using OpenSSL 3.X has been known since 2021. It was first mentioned in this open issue openssl/openssl#17064. There's not much we can do, since downgrading to version 1.1.1 is only a temporary fix. Since version 1.1.1 is no longer supported. |
With one of my scripts that is doing lots of HTTP requests through I concluded the move to OpenSSL 3.0 introduced these regressions. I found openssl/openssl#17627 which links multiple performance degradations. There, openssl/openssl#17627 (comment) suggests that OpenSSL 3.1 brings some improvements. Are there plans to move to OpenSSL 3.1+ in Python 3.11, 3.12, or higher? |
We haven't really discussed an update to 3.1 as far as I know, but I would not expect it. We prefer to avoid feature updates in our dependencies during the lifetime of a given Python release, so we'll probably stick to LTS OpenSSL releases (especially for 3.11 and 3.12), which 3.1 is not. I have not been able to quickly find whether 3.2 (currently at alpha 2) will be LTS or not. All that said, it should be possible to build and use your own 3.1 if you really need it. Have a look at the |
I don't have the necessary infrastructure to build my own binaries. So for now I'll have to live with it. However, after reading through #95031 I moved to a session based approach when using |
Bug report
Bug description:
After updating my Python from version 3.11.3 to 3.11.5 on Windows, I noticed unusually high CPU usage when running Python scripts. I ran simple python scripts with requests, and it was more evident when I started running multiple instances.
With Python version 3.11.3, my CPU usage is extremely low even when I have 100's of python instances running concurrently. (< 10%)
I tried other version of Python releases and found out this behavior is apparent for Python versions 3.11.5 and above.
3.11.3 - Normal
3.11.4 - Normal
3.11.5 - High CPU usage
3.12.0rc1 - High CPU usage
3.12.0rc2 - High CPU usage
Tested on both Widows 10 and 11.
Here's an example python code used.
CPython versions tested on:
3.11, 3.12
Operating systems tested on:
Windows 10, 11
The text was updated successfully, but these errors were encountered: