Skip to content

Instantly share code, notes, and snippets.

@koron
Last active October 25, 2022 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koron/2cb5bb0ba7c0f67a340c40c65c983be0 to your computer and use it in GitHub Desktop.
Save koron/2cb5bb0ba7c0f67a340c40c65c983be0 to your computer and use it in GitHub Desktop.
Compare pipeline performance between Redis and Dragonfly

Compare pipeline performance between Redis and Dragonfly

Previous article: https://gist.github.com/koron/0917506b5d30d1f4488389c2d7666a76

Setup

Start servers.

$ docker run --rm -d --name mem-redis redis:7.0.4-alpine3.16 --save "" --appendonly no

$ docker run --rm -d --name mem-dragon --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly:v0.10.0

Run memtier_benchmark

$ docker run --rm -it redislabs/memtier_benchmark:1.4.0 --thread 1 -n 200000 -c {CLIENT} --pipeline {PIPELINE} \
    --ratio 1:0 -d 256 --distinct-client-seed --hide-histogram -s {IP}

Where:

  • {CLIENT} : 1, 20
  • {PIPELINE} : 1, 10, 100, 1000
  • {IP} : 172.17.0.2, 172.17.0.3. depending on environment.

Short summary

1クライアントの時、Redisはパイプラインが多いほど速くなる。観測では4~50倍くらい。

1クライアントの時、Dragonflyもパイプラインが多いほど速くなるが、倍率はRedisほどではない。最大で2倍ほど。 そもそもの1クライアント・パイプライン使用時のスループットが悪い (7400ops/sec) ので、 Redis (13000ops/sec)と比べるとかなり見劣りする。 これは事前に知らされた観測結果と合致する。

20クライアント&100パイプラインにすれば Dragon (0.98Mops/sec) がスループットでRedis (0.61Mops/sec) に勝る。 クライアントが増えてるので接続の並列度が上がり、1コア駆動のRedisがサチって相対的に目減りしてると推測される。

ただしこの時、99パーセンタイル以上のレイテンシにおいて、Dragonfly側に異常値が観測されていることに注意が必要。

avg p50 p99 p99.9
Redis 2.748 3.199 3.631 5.023
Dragonfly 2.483 1.671 8.895 20.607

TL;DR

  • Dragonflyの単一接続でのスループットはかなり低い
    • 複数接続し並列処理させることで初めて速くなる
  • パイプラインの倍率そのものは低い
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment