Large number of delayed jobs with the same delayedTimestamp #1143
Unanswered
willemchua
asked this question in
Q&A
Replies: 1 comment 3 replies
-
So you are planning to add more than 4096 jobs per millisecond or in order words 4M jobs per second? If so, and the order is critical then yes this will be a problem. But I am quite sure you won't be able to reach this limit. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I'm new to BullMQ, and I'm hoping to use the delayed jobs feature in one of my projects.
So, as I understand it, when we add jobs to the "delayed" redis queue, it will add the
jobId
as the entry, with the score beingdelayedTimestamp * 4096 + (jobCounter & 4095)
(reference). So, this means that after 4095 jobs with the same delayedTimestamp, the order of the jobs wouldn't be retained.For example: delayedTimestamp = 10000 (for simplification)
After job 4096, it becomes
Is there any way to store more than 4096 delayed jobs with the same delayedTimestamp while still retaining the order of when the jobs are created? Initially I tried to set an epoch and the first part of a random uuid (ex:
1647545149603-cbd80f7b
) as the jobId so that the job order would be retained lexicographically (cmiiw, but I understood that to be how zrange in redis work).Please correct me if I'm wrong if this is not the actual behavior, and if it is, is there any way to retain the order of large number of delayed jobs with the same timestamp?
Beta Was this translation helpful? Give feedback.
All reactions