Redis Performance Debugging

84 views
Skip to first unread message

Raunak Bhansali

unread,
Sep 8, 2018, 6:34:44 PM9/8/18
to Redis DB

I am trying to benchmark redis SUNION command. While benchmarking one of the sets contains ~ 1000 elements and other contains ~10 elements.

The order of execution is around 0.52 ms per call.

Is this performance ideal or am I missing out on some tuning settings in the conf file.

Itamar Haber

unread,
Sep 8, 2018, 7:23:21 PM9/8/18
to Redis DB
Hello Raunak,

I don't know if the performance is ideal (sounds great, less than 1ms is great in my book, but it really depends on your requirements).

I've performed the below test on my laptop:

    $ for i in `seq 0 999`; do redis-cli sadd s1000 forbar$i; done
    ...
    $ for i in `seq 0 9`; do redis-cli sadd s10 foobar$i; done
    ...
    $ redis-benchmark SUNION s1000 s10
    ...
    100.00% <= 56 milliseconds
    1171.37 requests per second
    $ redis-benchmark SUNION s1000
    ...
    100.00% <= 57 milliseconds
    1062.70 requests per second
    $ redis-benchmark SMEMBERS s1000
    100.00% <= 19 milliseconds
    3300.33 requests per second
    $ redis-benchmark SINTER s1000
    100.00% <= 17 milliseconds
    3311.26 requests per second

These results (and some digging into the code) show that:

1. SUNION is slower than just getting the members of a set (SMEMBERS uses the same implementation as SINTER).
2. Iterating and replying with 1000 elements takes at least 17-19ms
3. The difference between SUNION and the others is not in orders of magnitude, which is good, but perhaps requires some optimizations in the Redis code (at least for this edge case).


--
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
Technicalist Evangenly

Phone: +972.54.567.9692

Redis Labs


Reply all
Reply to author
Forward
0 new messages