You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of them are only executed after the previous one's response is received. RedisQues therefor suffers more from higher roundtrip times towards Redis server.
The LPOP redisques:queues:oli is only used to remove the head-of-queue after successful message delivery - Redis response is not used. Better use LTRIM ...queue 1 -1 to remove head-of-queue without returning the message content.
Don't call LLEN redisques:queues:oli to check if queue is empty before starting the next consumption. Just do it, avoid this extra Redis command. Later, the LINDEX ... will detect the empty queue and stop processing
Do we really need to lookup 'who is' the consumer of a queue while 'we' are consuming this queue at the moment? In this case would easily assume that 'we' are still the consumer - remember that 'we' have a timer which refreshes that 'we' are the consumer.
In other words: No need for GET redisques:consumers:oli while we are in the consumption race. Perhaps we can have a look at myQueues to cross-check if we're still the consumer of this queue
The text was updated successfully, but these errors were encountered:
Situation
RedisQues executes the following sequence of eight Redis commands for dequeue of one message.
Example with a queue named "oli":
Most of them are only executed after the previous one's response is received. RedisQues therefor suffers more from higher roundtrip times towards Redis server.
Some ideas to improve this
EXPIRE redisques:consumers:oli 20
from the dequeuing sequence. RedisQues already refreshes consumer registration independently with a timer. No need to repeat this while dequeuing.GET redisques:consumers:oli
- Method RedisQues.consume(String queue) is only called for the current registered consumer - no need to check this here againLPOP redisques:queues:oli
is only used to remove the head-of-queue after successful message delivery - Redis response is not used. Better useLTRIM ...queue 1 -1
to remove head-of-queue without returning the message content.LLEN redisques:queues:oli
to check if queue is empty before starting the next consumption. Just do it, avoid this extra Redis command. Later, theLINDEX ...
will detect the empty queue and stop processingIn other words: No need for
GET redisques:consumers:oli
while we are in the consumption race. Perhaps we can have a look at myQueues to cross-check if we're still the consumer of this queueThe text was updated successfully, but these errors were encountered: