Number of max_workers when using ThreadPoolExecutor from concurrent.futures? Number of max_workers when using ThreadPoolExecutor from concurrent.futures? python python

Number of max_workers when using ThreadPoolExecutor from concurrent.futures?


I don't think this question can be so generically solved; it will depend on each case.

From this answer:

The more threads you use, the higher concurrency you'll achieve (up to a point), but the less CPU cycles you'll get (as there will be context switches). You have to instrument your application under typical workloads to see what works best for you. There is no universally optimal solution for this.