Redis官方已经说了,Redis有官方自己的性能测试工具!https://redis.io/topics/benchmarks

我们自己试试吧

redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]


参数说明
 -h <hostname>      Server hostname (default 127.0.0.1) 服务地址,默认是127.0.0.1
 -p <port>          Server port (default 6379) 服务端口,默认是6379
 -s <socket>        Server socket (overrides host and port)
 -a <password>      Password for Redis Auth Redis认证密码
 -c <clients>       Number of parallel connections (default 50)
 -n <requests>      Total number of requests (default 100000)
 -d <size>          Data size of SET/GET value in bytes (default 2)
 --dbnum <db>       SELECT the specified db number (default 0)
 -k <boolean>       1=keep alive 0=reconnect (default 1)
 -r <keyspacelen>   Use random keys for SET/GET/INCR, random values for SADD
  Using this option the benchmark will expand the string __rand_int__
  inside an argument with a 12 digits number in the specified range
  from 0 to keyspacelen-1. The substitution changes every time a command
  is executed. Default tests use this to hit random keys in the
  specified range.
 -P <numreq>        Pipeline <numreq> requests. Default 1 (no pipeline).
 -q                 Quiet. Just show query/sec values
 --csv              Output in CSV format
 -l                 Loop. Run the tests forever
 -t <tests>         Only run the comma separated list of tests. The test
                    names are the same as the ones produced as output.
 -I                 Idle mode. Just open N idle connections and wait.

官方的一个所有种类测试的典型例子

# 测试阶段 服务器CPU性能会占用变高
redis-benchmark -q -n 100000

图片说了 每秒SET 命令能处理34545.32个请求。其他的自行查看

宝塔Redis 的性能测试在:/www/server/redis/src

# 进入宝塔 redis-benchmark
cd /www/server/redis/src 

# 进行测试
./redis-benchmark -q -n 100000 -a 密码 -p 端口

示例:
./redis-benchmark -q -n 100000 -a xunliao2021 -p 33307