I don't understand python rq that much and I just started learning about it.
There is a task_a that takes 3 minutes to finish processing.
@job
def task_a():
time.sleep(180)
print('done processing task_a')
def call_3_times():
task_a.delay()
task_a.delay()
task_a.delay()
From what I observed, task_a will be executed one by one from the queue. After the first call is finished, then proceeds to the next call and so on. Total time taken is 3 minutes x 3 = 9 minutes
How can I make each task_a
in call_3_times
function be executed in parallel? so the time taken is lesser than 9 minutes probably 3 minutes and 10 sec (just an example it would probably be faster than that).
Probably I need to spawn 3 rq workers yes it does work faster and like parallel. But what if I need to call it 2000 times. Should I spawn 2000 rq workers? I mean, there must be a better way to do that.