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

Use lower priority queue for large imports #153

Closed
jacksonh opened this issue Feb 28, 2022 · 3 comments · Fixed by #293
Closed

Use lower priority queue for large imports #153

jacksonh opened this issue Feb 28, 2022 · 3 comments · Fixed by #293
Assignees
Labels

Comments

@jacksonh
Copy link
Contributor

When users import large libraries we should switch over to the low priority queue to keep performance predictable for all users.

To do this we can add a rate limit type check to the import path. In before adding to the task queue based on some heuristics we can decide to use either the normal or the low priority task queue. There is a task queue omnivore-prod-queue-low that dispatches to the cloud function at a lower rate (3 per second vs 500).

To do this we will need to create a low priority queue in the demo environment also.

As a first pass at our logic I think we can do:

5 articles added in the last minute: use low queue
default: use normal queue

You can see how we pass a priority param to the cloud task function here:

const createHttpTaskWithToken = async ({

@jacksonh jacksonh added the API label Feb 28, 2022
@jacksonh jacksonh modified the milestones: 2022-03-03, 2022-03-10 Feb 28, 2022
@jacksonh jacksonh removed this from the 2022-03-10 milestone Mar 16, 2022
@jacksonh
Copy link
Contributor Author

@sywhb not sure if there is a good way with elastic to do something like 'select count(*) from links where user_id ... and DATE(created_at) > 1hr ago

@sywhb
Copy link
Contributor

sywhb commented Mar 18, 2022

@sywhb not sure if there is a good way with elastic to do something like 'select count(*) from links where user_id ... and DATE(created_at) > 1hr ago

@jacksonh Yeah. Elastic has this aggregation query to get count

@sywhb sywhb self-assigned this Mar 22, 2022
@sywhb sywhb linked a pull request Mar 22, 2022 that will close this issue
@sywhb
Copy link
Contributor

sywhb commented Mar 22, 2022

We have a low priority queue in the demo environment: omnivore-demo-queue-low

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

Successfully merging a pull request may close this issue.

2 participants