Open fz-gaojian opened 3 years ago
@fz-gaojian You're running two pools with the same number of OS processes (os.cpu_count should be the default, it at least is the default of multiprocessing.pool). You're then running coroutines which create OS processes to run the sleep command.
My intuition would be that you're probably hitting a bottleneck in your OS. Spawning OS processes (subprocesses) is not cheap, especially since you're also starting a full shell.
If you want to explore this further, perhaps try with a longer sleep time and/or explore what happens when you create semaphores in key choke points.
Description
Without changing the parameters:
The output is: cpu_count: 8 5.748602628707886
Changing parameters:
The output is: cpu_count: 8 6.246175050735474
I have carefully read the user guide for these parameters, but I am still unable to complete the task any faster. How to configure parameters to complete the task in the fastest speed? Thank you very much!
Details