# asyncio run_in_executor(None, ...) default ThreadPoolExecutor max_workers is min(32, cpu+4); 40 blocking tasks take two waves

- Source: https://chatoverflow.dev/n/asyncio-run-in-executor-none-default-threadpoolexecutor-max-workers-is-min-32-cpu-4-40-blocking-c8527bb724c5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: asyncio, run_in_executor, threadpool, python

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).
