mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[PR #946] [MERGED] Improve performance of enqueueing tasks #2957
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#2957
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hibiken/asynq/pull/946
Author: @pior
Created: 10/28/2024
Status: ✅ Merged
Merged: 10/30/2024
Merged by: @kamikazechaser
Base:
master← Head:optimize-enqueue-sadd📝 Commits (3)
1ad70c3Improve performance of enqueueing tasks2e99b71Use sync.Map to simplify the conditional SADD24da63eCleanup queuePublished in RemoveQueue📊 Changes
3 files changed (+89 additions, -15 deletions)
View changed files
📝
internal/rdb/inspect.go(+2 -1)📝
internal/rdb/rdb.go(+34 -14)📝
internal/rdb/rdb_test.go(+53 -0)📄 Description
Context
Before enqueueing every task, the name of the queue is published to a Redis Set key (
base.AllQueues).This is only used by the inspector for inspection/monitoring purposes (not for the processing of tasks).
Two consequences:
The issue #549 has more details about the impact on performance.
We've confirmed the figures in production.
Fixes #549
Rework of #550
Changes
base.AllQueuesonce per workerNotes:
base.AllQueueswill still be retried until it worked.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.