Performance degradation since LUA pop
ofirnk opened this issue · comments
Ofir Naor commented
Hey,
Since version 2.1.1
we're seeing a major performance hit on large (~150K) delayed queue.
After some investigation we've spotted a redis API change:
While version 2.1.0
used
final Set<Tuple> payloadSet = this.jedis.zrangeByScoreWithScores(key, -1, now, 0, 1);
On the new (and awesome!) lua script the LIMIT is missing:
next(redis.call('ZRANGEBYSCORE', queueKey, '-inf', now, 'WITHSCORES')
Ofir Naor commented
So it looks the only change that is needed is this:
redis.call('ZRANGEBYSCORE', queueKey, '-inf', now, 'WITHSCORES', 'LIMIT' , '0' , '1')
(added the last 3 parameters)