Pebble's process pools take parameters for max_workers and max_tasks.
https://pythonhosted.org/Pebble/#pools
The description of max_tasks is a little unclear:
"If max_tasks is a number greater than zero each worker will be restarted after performing an equal amount of tasks."
My question is:
What if it is not greater than zero? How does it behave then?
What does it mean to restart a worker? Let's say max_tasks is 5. Then will each process execute 5 iterations, then be killed, and a new process restated? What is the benefit of doing this?
I know that other libraries allow you to customize pool maps depending on whether each task is expected to take similar time to complete, or not. Is that relevant here?
In general, what guidelines are there for setting max_tasks?
I'm running a function that needs to be run on every element of a list of length += 160 000. It's completely parallelizable, and my server has 8 cores. each function call will take apporx the same time to complete, at most 3 times longer than the average time.
Thanks.