10.1.性能测试

redis

机器条件

  • 操作系统:Windows 10专业版

  • 处理器:lntel(R)Core(TM) i5-6200U CPU @2.30GHz 2.40 GHz

  • 已安装的内存(RAM):16.0 GB (15.9 GB可用)

  • 系统类型:64位操作系统,基于x64的处理器

测试一:RPS测试

C:\Users\moluo>redis-benchmark -n 10000 -q
PING_INLINE: 9345.79 requests per second
PING_BULK: 9380.86 requests per second
SET: 9871.67 requests per second
GET: 8984.73 requests per second
INCR: 9425.07 requests per second
LPUSH: 6501.95 requests per second
RPUSH: 6605.02 requests per second
LPOP: 5878.90 requests per second
RPOP: 5296.61 requests per second
SADD: 6544.50 requests per second
SPOP: 6418.49 requests per second
LPUSH (needed to benchmark LRANGE): 6570.30 requests per second
LRANGE_100 (first 100 elements): 5640.16 requests per second
LRANGE_300 (first 300 elements): 3563.79 requests per second
LRANGE_500 (first 450 elements): 3020.24 requests per second
LRANGE_600 (first 600 elements): 2573.34 requests per second
MSET (10 keys): 5274.26 requests per second

结论:

支持万级RPS,随着请求数增加,RPS逐渐下降

测试二:延时测试

结论

10ms级别

Mysql

机器条件

  • 操作系统:Windows 10专业版

  • 处理器:lntel(R)Core(TM) i5-6200U CPU @2.30GHz 2.40 GHz

  • 已安装的内存(RAM):16.0 GB (15.9 GB可用)

  • 系统类型:64位操作系统,基于x64的处理器

测试:RPS测试

结果中各项含义:

Average number of : 运行所有语句的平均秒数

Minimum number of :运行所有语句的最小秒数

Maximum number of:运行所有语句的最大秒数

Number of clients:客户端数量

Average number of queries per client:每个客户端运行查询的平均数

结论

18 requests per second

参考文档

Redis 性能测试

Mysql 压力测试工具 mysqlslap

MySQL自带的性能压力测试工具mysqlslap详解

Last updated

Was this helpful?