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

Bulk / Batch Processor worker - process many jobs at once #2516

Open
mariuszbeltowski opened this issue Apr 9, 2024 · 3 comments
Open

Bulk / Batch Processor worker - process many jobs at once #2516

mariuszbeltowski opened this issue Apr 9, 2024 · 3 comments

Comments

@mariuszbeltowski
Copy link

Is your feature request related to a problem? Please describe.
Example case: Application receives 3k events from API per second. We want to store them in the database, but processing every event as single insert would generate 3k/s inserts and heavily loads the db. The solution is to use bulk insert, but to use that we need a way to read jobs in a bulk way inside the processor. This is a common practice with other queue systems.

Describe the solution you'd like
Allow the processor to receive many jobs in once instead of only one.

Describe alternatives you've considered

Additional context

@mariuszbeltowski mariuszbeltowski changed the title Bulk Processor - process many jobs at once Bulk / Batch Processor worker - process many jobs at once Apr 9, 2024
@roggervalf
Copy link
Collaborator

hi @mariuszbeltowski, we support batch processing in pro version, pls take a look https://docs.bullmq.io/bullmq-pro/batches

@mariuszbeltowski
Copy link
Author

hi @mariuszbeltowski, we support batch processing in pro version, pls take a look https://docs.bullmq.io/bullmq-pro/batches

Thank you @roggervalf . How it will work if we set 10 items per batch, but on the queue we will get just 8? Is there any timeout for fulfilling the worker for items.length < batch? Can we control that timeout? I couldn't find that in the docs.

@manast
Copy link
Contributor

manast commented Apr 10, 2024

@mariuszbeltowski it will take up to 10, if there are less than 10 then it will take all the ones that are left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants