Time Complexity: Queue.add(), Queue.getJob(jobId), Job.remove() #2134
Replies: 3 comments 16 replies
-
Of the three operations you want to use to update the delayed job, |
Beta Was this translation helpful? Give feedback.
-
Hi, @manast,
My Doubt here is why It is saying to move from active to delayed. Case 2:
When I am trying to release lock before calling moveToDelayed functions. It gives the above error. Can you please tell me how to use this function. I am not able to find any answer for this. EDIT: |
Beta Was this translation helpful? Give feedback.
-
@manast
To replicate our live system we tried adding around 10 million jobs to the queue and load test OnEvent api. But we encountered a road block while adding more jobs to queue, aws machine cache.r5.large size (13 gb memory).
|
Beta Was this translation helpful? Give feedback.
-
My use case is to create dynamic delayed job and based on some event add some seconds to the delayed interval (further delay the job)
Since I could not find any
function
to update the Delayed Interval for a Job I came up with the following steps:This pretty much solves my problem, But I am worried about the scale at which these operations will happen.
I am expecting nearly 50K events per minute or even more in near future.
My queue size is expected to grow based on unique JobId.
I am expecting more than:
Also, after 60-70 days delayed interval for jobs will reach, and older jobs will be removed one by one.
I can run multiple processor to handle these delayed job which is not an issue.
My queue size will be stabilise after 60-70 days and more or less my queue will have around 10 million jobs.
I can vertically scale my redis as required.
But I want to understand the time complexity for below queries:
If any of these operations are O(N) OR
My queue can keep some max number of Jobs which is less than 10 million
Then I might have to discard this design and come up with something entirely different.
Need advice from experienced folks who can guide me on how solve this problem.
Beta Was this translation helpful? Give feedback.
All reactions