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

Implement bulk key fetching and deleting for large queue #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

shioshiota
Copy link
Contributor

@shioshiota shioshiota commented Sep 7, 2021

We want to reduce redis load by delete-queue command when the queue has a large number of tasks.
*a large number is about 10^6

I implemented following improvements:

fixes #28

@shioshiota shioshiota force-pushed the feature/bulk-redis-operation branch 2 times, most recently from 7b3b989 to d3e5936 Compare September 7, 2021 07:45
@shioshiota shioshiota marked this pull request as ready for review September 7, 2021 10:48
@shioshiota shioshiota changed the title [WIP] update: use SScan instead of SMembers Command update: use SScan instead of SMembers Command Sep 7, 2021
@shioshiota shioshiota changed the title update: use SScan instead of SMembers Command Implement bulk key fetching and deleting to handle a large quantity tasks in a queue Sep 7, 2021
@shioshiota shioshiota changed the title Implement bulk key fetching and deleting to handle a large quantity tasks in a queue Implement bulk key fetching and deleting to handle a large quantity of tasks in a queue Sep 7, 2021
@shioshiota shioshiota changed the title Implement bulk key fetching and deleting to handle a large quantity of tasks in a queue Implement bulk key fetching and deleting to handle a number quantity of tasks in a queue Sep 7, 2021
Copy link
Contributor

@everpeace everpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left several comments. PTAL.

pkg/backend/config/config.go Outdated Show resolved Hide resolved
pkg/backend/redis/queue.go Outdated Show resolved Hide resolved
pkg/backend/redis/queue.go Outdated Show resolved Hide resolved
Client: client,
Backoff: backoffConfig,
ChunkSizeInGet: 1000,
ChunkSizeInDelete: 1000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding tests for chunked deletion (large queue)??

Copy link
Contributor Author

@shioshiota shioshiota Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test for chunked deletion.
f2b8503

@everpeace everpeace changed the title Implement bulk key fetching and deleting to handle a number quantity of tasks in a queue Implement bulk key fetching and deleting for large queue Sep 7, 2021
@everpeace everpeace added the release-note/feature Feature category in release note label Sep 7, 2021
shioshiota and others added 2 commits September 8, 2021 17:19
Co-authored-by: Shingo Omura <everpeace@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/feature Feature category in release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The same problem as #25 occurs with delete-queue for large queues
2 participants