How to make queues pick up messages

How to make queues pick up messages faster? Currently I see a few seconds lag from message being inserted in queue, vs being picked up. This is critical for UX. I want to reduce this time. Will it be better if I shift to a workflow ?
5 Replies
bert
bert2d ago
I've noticed this as well - I've set max_batch_size to 1 and max_batch_timeout to 0 in my consumer Worker and I'm still seeing 10-15 seconds of delay between writing and consuming it.
switz
switz2d ago
I see <= 6s using http pull Oct 1 21:58:26 -> 17:58:32 yeah next one was 56->59. basically instant (clock drift, polling, etc.) probably closer to 1s realtime that's e2e too: so going from a remote server halfway across the world -> worker -> queue -> my server.
Tero
Tero2d ago
It has been discussed earlier in the channel, and I think the conclusion was that currently queues are not well suited for low latency use cases. I think there might be some improvements coming in this area, but no clue when that might happen.
Shivek
ShivekOP2d ago
Did anyone here try workflows instead ? I can have a one step workflow as I need to maintain object state (cannot be durable). The 4 second pause is killing my UX. Max batch timeout doesn't make sense if max_batch_size is 1. As soon as there is 1 item in the queue, the consumer will be triggered.
bert
bert23h ago
Correct. I started with just max_batch_size, it didn't really work, and I added timeout just in case.

Did you find this page helpful?