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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃挕 FEATURE REQUEST]: Option to limit the concurrency of the JOBS drivers #1380

Open
3 of 7 tasks
rustatian opened this issue Nov 28, 2022 · 5 comments
Open
3 of 7 tasks
Assignees
Labels
C-feature-accepted Category: Feature discussed and accepted P-jobs Plugin: Jobs

Comments

@rustatian
Copy link
Member

rustatian commented Nov 28, 2022

Plugin

JOBS

I have an idea!

A new option that can limit the parallelism per pipeline. For example, if you use the SQS FIFO queue, at the moment, you might receive three messages at the same time. The workers might serve these three messages randomly (e.g. 2->1->3). For the cases when that is required to follow the FIFO order (for example), we need a new option to consume a new message from any queue in a particular order.
For example:
parallelism: 1: would mean we can have only 1 message (JOB) in the RR's internal queue before the ACK. So, the SQS FIFO order will be preserved.

parallelism: N: would mean we can have N messages simultaneously in the internal priorities queue.

EDIT:

  1. AMQP -> supports this option, no changes are needed.
  2. SQS -> doesn't support, add the prefetch configuration option.
  3. Beanstalk -> doesn't support, add the prefetch configuration option.
  4. NATS -> doesn't support, add the prefetch configuration option.
  5. Kafka -> not sure, need to investigate.
  6. in-memory -> update the prefetch configuration option.
  7. localdb -> update the prefetch configuration option.
@rustatian rustatian added C-feature-accepted Category: Feature discussed and accepted P-jobs Plugin: Jobs labels Nov 28, 2022
@rustatian rustatian added this to the v2.12.1 milestone Nov 28, 2022
@rustatian rustatian self-assigned this Nov 28, 2022
@rauanmayemir
Copy link

I鈥檓 doing this currently with AMQP by setting a fetch size. Will this option just be a generalization on top of that?

@wolfy-j
Copy link
Contributor

wolfy-j commented Nov 28, 2022

Pretty much - yes.

@rustatian
Copy link
Member Author

Yeah, the AMQP driver already has this option via prefetch. I'm unsure about Kafka (max.poll.records) and SQS (Java SDK has smt like batches, but I don't see this option for the Golang driver).

@wolfy-j
Copy link
Contributor

wolfy-j commented Nov 28, 2022

Except it will be done on RR level, not driver level. Before it reaches internal task queue.

@rustatian
Copy link
Member Author

rustatian commented Nov 28, 2022

I think that the more natural and, let's say, 'expected' name for this option is - prefetch.

But on the other hand, we have drivers (like amqp) that support this option in that 'expected' way, and our new option will conflict with the natural option, which in my opinion, will confuse users. It's like prefetch <-> rr_prefetch 馃槙.

I think adding the prefetch option to the drivers that don't support that option via their configuration is essential (by configuration here, I mean natural driver's configuration).

@rustatian rustatian modified the milestones: v2.12.1, v2.12.2 Dec 5, 2022
@rustatian rustatian modified the milestones: v2.12.2, v2023.01 Jan 6, 2023
@rustatian rustatian removed this from the v2023.1.0 milestone Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-accepted Category: Feature discussed and accepted P-jobs Plugin: Jobs
Projects
Status: 馃搵 Backlog
Development

No branches or pull requests

3 participants