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

configure concurrency levels for background worker #23

Open
ChuckHend opened this issue Aug 14, 2023 · 1 comment
Open

configure concurrency levels for background worker #23

ChuckHend opened this issue Aug 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ChuckHend
Copy link
Member

ChuckHend commented Aug 14, 2023

bgworker currently runs single instance. allow for configuring the number of concurrent bgw that can execute jobs.

We will need to handle the pgmq visibility timeout more careful when there are concurrent workers reading jobs. When background worker picks up a task, it will set the VT to 100 seconds:

match queue.read::<Job>(PGMQ_QUEUE_NAME, 100).await {

Any task lasting longer than 100 seconds will be subject to duplicate processing.

@ChuckHend ChuckHend added the enhancement New feature or request label Aug 14, 2023
@ChuckHend
Copy link
Member Author

Can add a guc to set number of bgw to run, and implement it similar to pg-vectorize

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

No branches or pull requests

1 participant