Skip to content

OpenSSL 3 performance regression on Windows #109386

@boxothing

Description

@boxothing

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.

from concurrent.futures import ProcessPoolExecutor
import time
import requests

def worker(name):
    while True:
        try:
            res = requests.get("https://httpbin.org/get")

            if res:
                print(f"Worker {name}: {res.status_code}")
        except:
            pass

        time.sleep(3)

def start_worker(workers):
    executor = ProcessPoolExecutor(max_workers=workers)

    for n in range(workers):
        executor.submit(worker, n)
        time.sleep(1)

    executor.shutdown(wait=False)

if __name__ == '__main__':
    print("Starting workers ...")
    start_worker(20)

CPython versions tested on:

3.11, 3.12

Operating systems tested on:

Windows 10, 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions