Skip to content

Support executor="processes" and the like to Worker #5319

Open
@gjoseph92

Description

@gjoseph92

Being able to specify the worker's executor(s) is a neat feature that's probably under-used in part because it's currently a somewhat cumbersome API: you need to create and pass in the executor instance(s) you want to use.

On cloud deployments or using a spec cluster, this is awkward. You currently have write a worker plugin to do this (see https://youtu.be/vF2VItVU5zg?t=515). Instead, it would be nice if you could just do:

  • Worker(..., executor="processes")
  • Worker(..., executor="threads")
  • Worker(..., executor="concurrent.futures.ThreadPoolExecutor")
  • Worker(..., executor="loky.ProcessPoolExecutor")
  • Worker(..., executor={"default": "threads", "process": "processes"})

If this is done, some other cleanup should follow:

  • LocalCluster(processes=True) should create workers with executor="processes" instead of multiple single-threaded workers
  • dask-worker --nprocs should do the same as above (xref Remove --nprocs keyword from dask-worker command? #2471)
  • Perhaps nthreads should generally be renamed to concurrency or something? So concurrency= controls the pool size, executor= controls the pool type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprove existing functionality or make things work betterhelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions