Zachary Loertscher
04/18/2023, 5:50 PM"n_workers"
kwarg. I've tried "n_workers":8
and "n_workers":1
, but they both kick off all 14 of my tasks at the same time
What I want to do is the following (worked in prefect 1), but "scheduler ":"threads" is not accepted as a kwarg.
task_runner=DaskTaskRunner( #allows for parallel execution
cluster_kwargs={
"n_workers": 8,
"scheduler": 'threads'
}
For context, I need it to only run 8 tasks at a time, not all 14. If it runs all of them, it crashes the CPU on my EC2. I'm pouring over the docs but I'm not seeing anything on thisRyan Peden
04/18/2023, 5:57 PMZachary Loertscher
04/18/2023, 6:00 PM"n_workers"
kwarg serve? Do all workers have unlimited task-concurrency? Is each worker designated to run on a single thread?Ryan Peden
04/18/2023, 6:17 PMDaskTaskRunner
uses distributed.LocalCluster
by default, which IIRC will start a separate process (each with multiple threads) for each worker unless you specify "processes": False
as of of the args to the cluster...in which case I believe it uses a thread per worker, though you can also specify threads_per_worker
just to be sure.
Docs for dask.LocalCluster
are here: https://docs.dask.org/en/stable/deploying-python.html#referenceRyan Peden
04/18/2023, 6:19 PMRyan Peden
04/18/2023, 6:21 PMtask_runner=DaskTaskRunner(
cluster_kwargs={
"processes": False
"n_workers": 8
}
Zachary Loertscher
04/18/2023, 6:22 PMChoenden Kyirong
04/18/2023, 9:04 PMZachary Loertscher
04/19/2023, 3:03 PMRyan Peden
04/20/2023, 9:21 PM