返回归档

Kedis 性能数据记录(不定期更新)

Kedis 性能数据记录(不定期更新)

所有 QPS 相关的数据, 测试参数如下

HOST="127.0.0.1"
KEYS=1000000
THREADS=4
CONN=50
REQS_PER_CLIENT=$((KEYS / (THREADS * CONN)))
# memtier_benchmark 默认小key小value (value大小32B)
memtier_benchmark \
    -s ${HOST} \
    -p ${PORT} \
    --command="HSET/HDEL __key__ __data__" \
    --command-ratio=1 \
    --command-key-pattern=P \
    -t ${THREADS} \
    -c ${CONN} \
    -n ${REQS_PER_CLIENT} \
    --random-data \
    --key-prefix="k" \
    --key-minimum=1 \
    --key-maximum=${KEYS} \
    --json-out-file="$json_file" \
    --hide-histogram

KSF 加载时间

更新时间: 2026.4.30

image-20260501001844138

pipeline 性能 --- Redis VS Kedis

更新时间: 2026.5.1

image-20260501113651033

AOF 性能(预热后) --- Redis VS Kedis

更新时间: 2026.4.30

image-20260501014217042

更新时间: 2026.5.1

优化了一下 aof buffer flush 的路径

image-20260501132850772

增量同步性能

更新时间: 2026.5.1

image-20260513162907601

RDMA vs sendfile

RDMA send

soft-RoCE image-20260501120557336

sendfile

image-20260501120523806

kmem vs jemalloc

更新时间: 2026.5.6

1. jemalloc

❯❯❯ pidstat -r -p $(pidof kvstore) 1 200 Linux 6.18.26-2-lts (Arch) 2026年05月06日 x86_64 (18 CPU)

10时17分25秒 UID PID minflt/s majflt/s VSZ RSS %MEM Command 10时17分26秒 1000 81024 0.00 0.00 987108 436040 1.34 kvstore 10时17分27秒 1000 81024 0.00 0.00 987108 436040 1.34 kvstore 10时17分28秒 1000 81024 0.00 0.00 987108 436040 1.34 kvstore 10时17分29秒 1000 81024 0.00 0.00 987108 436040 1.34 kvstore 10时17分30秒 1000 81024 205.00 0.00 987108 436472 1.35 kvstore — 开始 SET 10时17分31秒 1000 81024 4395.00 0.00 1009636 452888 1.40 kvstore 10时17分32秒 1000 81024 3016.00 0.00 1031140 474376 1.46 kvstore 10时17分33秒 1000 81024 5997.00 0.00 1053668 495500 1.53 kvstore 10时17分34秒 1000 81024 4333.00 0.00 1068004 512780 1.58 kvstore 10时17分35秒 1000 81024 2448.00 0.00 1084388 530220 1.63 kvstore 10时17分36秒 1000 81024 55.00 0.00 1084388 536868 1.65 kvstore — 开始 DEL 10时17分37秒 1000 81024 0.00 0.00 1084388 523424 1.61 kvstore 10时17分38秒 1000 81024 0.00 0.00 1084388 505760 1.56 kvstore 10时17分39秒 1000 81024 0.00 0.00 1084388 492056 1.52 kvstore 10时17分40秒 1000 81024 0.00 0.00 1084388 479652 1.48 kvstore 10时17分41秒 1000 81024 0.00 0.00 1084388 462540 1.43 kvstore 10时17分42秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分43秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分44秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分45秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分46秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分47秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分48秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分49秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分50秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore 10时17分51秒 1000 81024 0.00 0.00 1084388 458020 1.41 kvstore

2. kmem

❯❯❯ pidstat -r -p $(pidof kvstore) 1 200 Linux 6.18.26-2-lts (Arch) 2026年05月06日 x86_64 (18 CPU)

10时19分21秒 UID PID minflt/s majflt/s VSZ RSS %MEM Command 10时19分22秒 1000 82535 0.00 0.00 999396 845468 2.61 kvstore 10时19分23秒 1000 82535 0.00 0.00 999396 845468 2.61 kvstore 10时19分24秒 1000 82535 0.00 0.00 999396 845468 2.61 kvstore 10时19分25秒 1000 82535 0.00 0.00 999396 845468 2.61 kvstore 10时19分26秒 1000 82535 2311.00 0.00 1022436 866896 2.67 kvstore — 开始 SET 10时19分27秒 1000 82535 10754.00 0.00 1067492 909664 2.80 kvstore 10时19分28秒 1000 82535 12289.00 0.00 1108452 958480 2.95 kvstore 10时19分29秒 1000 82535 10240.00 0.00 1149412 999376 3.08 kvstore 10时19分30秒 1000 82535 9216.00 0.00 1186276 1036096 3.19 kvstore 10时19分31秒 1000 82535 10240.00 0.00 1227236 1076848 3.32 kvstore — 开始 DEL 10时19分32秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分33秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分34秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分35秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分36秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分37秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分38秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分39秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分40秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分41秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore 10时19分42秒 1000 82535 0.00 0.00 1227236 1076848 3.32 kvstore

kmem 现象

(1) 分配即访问

(2) 没 trim

(3) init 时不仅分配还写入

(4) 内部碎片多, size 不紧凑


kmem vs jemalloc 的 QPS 数据

更新时间: 2026.5.6

jemalloc

未预热

kedis,no,HSET,196813.2

kedis,no,HDEL,201302.06

预热后

kedis,no,HSET,199344.16

kedis,no,HDEL,199484.41


kmem

未预热

kedis,no,HSET,192399.79

kedis,no,HDEL,194943.97

预热后

kedis,no,HSET,197803.63

kedis,no,HDEL,196702.52