redis 性能测试
环境
redis 7.2.5

测试结论
当前场景下 redis 单线程、多线程表现差异不大
使用 pipeline 模式可以显著提高基准性能
非 pipilie 下 redis 性能再 12~13w 左右
pipiline 下 redis 性能在 35w 左右
测试记录
单线程 redis 基准测试(只测试 set,客户端与 redis 不同节点)
Redis-benchmark 测试(跨机器传输,写入 256 字节,一个 key)
redis-benchmark -h 192.168.8.63 -p 6379 -t set -n 32000000 -d 256
网络带宽

Redis cpu 占用

性能指标
12.6w

python 多进程程序测试(跨机器传输,写入 256 字节,不同的 key)
网络带宽

Redis cpu 占用

性能指标
13W

Redis-benchmark 测试(跨机器传输,Pipeline 模式 p=16,写入 256 字节,key 空间 100000000)
redis-benchmark -h 192.168.8.63 -p 6379 -t set -n 32000000 -d 256 -r 10000000 -P 24
网络带宽

Redis cpu 占用

性能指标
34.w

Redis 开启 8 个 IO 线程,未开启持久化(只测 set,客户端与 redis 相同节点)
Redis-benchmark 测试(写入 3 字节,一个 key)
./redis-benchmark -h 192.168.8.63 --threads 8 -n 100000000 -c 200 -t set
Redis cpu 占用

性能指标
平均 16W 左右

Redis-benchmark 测试(写入 256 字节,key 空间 100000000)
Redis cpu 占用

性能指标
平均 12.2W 左右


Redis-benchmark 测试(Pipeline 模式 p=16,写入 256 字节,key 空间 100000000)
./redis-benchmark -h 192.168.8.63 --threads 8 -n 10000000 -t set -r 100000000 -d 256 -c 200 -P 16
性能指标
35.5W

Redis-benchmark 测试(跨机器传输,Pipeline 模式 p=16,写入 256 字节,key 空间 100000000)
redis-benchmark -h 192.168.8.63 -p 6379 -t set -n 32000000 -d 256 -r 10000000 -P 24
网络带宽

Redis cpu 占用

性能指标
33.9w

文章转载自:by_mzy
评论