MGET Performance Issue

567 views
Skip to first unread message

Chris Stanaway

unread,
Feb 9, 2018, 2:43:35 PM2/9/18
to Redis DB
Redis 4.0.7 / ioredis 3.2.2

I had some logic to retrieve a set of entries by pipelining a bunch of GETs:

// node.js (ioredis package)
let redisCmds = [];
for (let i = 0; i < keys.length; i++) {
    redisCmds.push([ 'get', keys[i] ]);
}
let pipeline = redisClient.multi(redisCmds);
pipeline.exec(function (err, values) { ... }

I switched to MGET:

redisClient.mget(keys, function (err, values) { ... });

Should be better, right?  Not really.

We had a couple dozen clients doing load testing and performance went to crap.  The number of keys being retrieved per operation wasn't very many (< 10), but we experienced a major degradation in overall performance.  I switched back to pipeling GETs and performance went back up.

Anyone else experience this?  Any suggestions?  I would have thought that MGET would have performed better, but that was not our experience.  In fact, with MGET, performance started high and then quickly trended to poor as the load test progressed.  It almost appears that even though the pipelined GETs are supposed to be treated as one atomic transaction that they allow interrupts while MGET experienced longer processing delays (perhaps more internal blocking?).

hva...@gmail.com

unread,
Feb 9, 2018, 10:29:07 PM2/9/18
to Redis DB
Does the redis-benchmark program see results that are consistent with your nodejs client?  If so, there are server-side measurements and configurations that you can dig into.  If not, then the performance limit may be from how the package or other code is functioning.

Chris Stanaway

unread,
Feb 9, 2018, 10:57:33 PM2/9/18
to redi...@googlegroups.com
I'll have to investigate further with the redis-benchmark program.

Chris

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Itamar Haber

unread,
Feb 10, 2018, 11:52:33 AM2/10/18
to Redis DB
This sounds weird indeed. Can you recreate/reproduce this with redis-benchmark so we can rule out stack-related issues?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Technology Evangelist
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Twitter: @itamarhaber
Skype: itamar.haber

Reply all
Reply to author
Forward
0 new messages