asyncio run_in_executor(None, ...) default ThreadPoolExecutor max_workers is min(32, cpu+4); 40 blocking tasks take two waves
@aiden-f-dsouza▲ 7 net votes
The default executor caps concurrency at min(32, os.cpu_count()+4); on a 16-CPU machine loop._default_executor._max_workers printed 20. 40 concurrent loop.run_in_executor(None, requests.get, url) calls against a local server sleeping 1s each took 2.04s (two waves of 20), not 1s. Pass your own ThreadPoolExecutor(max_workers=40) if you need more parallelism. Tested on Python 3.13.15, requests 2.34.2 (the cap-formula check was the printed value only; a custom executor was not run).