Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check concurrency limit before submitting tasks to TaskRunner #8539

Open
3 tasks done
j-tr opened this issue Feb 15, 2023 · 5 comments
Open
3 tasks done

Check concurrency limit before submitting tasks to TaskRunner #8539

j-tr opened this issue Feb 15, 2023 · 5 comments
Assignees
Labels
concurrency enhancement An improvement of an existing feature needs:design Blocked by a need for an implementation outline

Comments

@j-tr
Copy link
Contributor

j-tr commented Feb 15, 2023

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar request and didn't find it.
  • I searched the Prefect documentation for this feature.

Prefect Version

2.x

Describe the current behavior

Concurrency limits are checked after the task is submitted to the TasksRunner. For distributed task runners like Ray, this causes upscaling based on the total number of submitted tasks and not on the number of runnable tasks according to the concurrency limits. Especially for flows with a large number of tasks but rather low concurrency limits, this causes massive overprovisioning of compute resources.

Describe the proposed behavior

Only submit tasks to the task runner when free concurrency slots are available, which would lead to upscaling based on the concurrency limits and not the total number of tasks.

Example Use

No response

Additional context

No response

@j-tr j-tr added enhancement An improvement of an existing feature status:triage labels Feb 15, 2023
@zanieb
Copy link
Contributor

zanieb commented Feb 21, 2023

Unfortunately this is a bit difficult as scaling to large numbers of tasks requires that orchestration of the tasks occur in a distributed manner.

@zanieb zanieb added needs:design Blocked by a need for an implementation outline priority:low and removed status:triage labels Feb 21, 2023
@zanieb
Copy link
Contributor

zanieb commented Feb 23, 2023

@j-tr would a client-side setting that controls the number of concurrently submitting task runs suffice for you?

@j-tr
Copy link
Contributor Author

j-tr commented Feb 24, 2023

@madkinsz I'm afraid that a purely client-side approach would probably not help very much. we already considered application-level workarounds that only submit a certain number of tasks at a time, but since our main objective is to protect a database and we have no control over the number of concurrently running flows, we need some sort of global limit.
However, a read-only solution that reads the number of available concurrency slots from the server and only submits an according number of tasks would already reduce the amount of overprovisioning by a bit and keep most of the orchestration logic distributed.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. To keep this issue open remove stale label or comment.

@trahloff
Copy link

Hi @billpalombi, is this capability something that is on the current roadmap?

@zzstoatzz zzstoatzz self-assigned this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency enhancement An improvement of an existing feature needs:design Blocked by a need for an implementation outline
Projects
None yet
Development

No branches or pull requests

6 participants