您的位置:js12345金沙官网登入 > 网络编程 > 关于redis状态监控和性能调优详解js12345金沙官网

关于redis状态监控和性能调优详解js12345金沙官网

2020-03-13 10:54

前言

 本文主要介绍及演示一些Redis相关的状态监控和性能调优的命令及使用方法:

对于任何应用服务和组件,都需要一套完善可靠谱监控方案。

 1、redis-benchmark

尤其redis这类敏感的纯内存、高并发和低延时的服务,一套完善的监控告警方案,是精细化运营的前提。

redis基准信息,redis服务器性能检测 

本文主要给大家介绍了关于redis状态监控和性能调优的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧。

例如:

1、redis-benchmark

检测redis服务器性能,本机6379端口的实例,100个并发连接,100000个请求

redis基准信息,redis服务器性能检测

redis-benchmark -h localhost -p 6379 -c 100 -n 100000 

例如:

js12345金沙官网登入 1js12345金沙官网登入 2

js12345金沙官网登入,检测redis服务器性能,本机6379端口的实例,100个并发连接,100000个请求

[root@redis-server ~]# redis-benchmark -h localhost -p 6379 -c 100 -n 100000 
====== PING_INLINE ======
  100000 requests completed in 1.29 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

81.97% <= 1 milliseconds
97.69% <= 2 milliseconds
99.79% <= 3 milliseconds
99.94% <= 4 milliseconds
99.97% <= 5 milliseconds
100.00% <= 5 milliseconds
77639.75 requests per second

====== PING_BULK ======
  100000 requests completed in 1.49 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

73.04% <= 1 milliseconds
97.46% <= 2 milliseconds
99.62% <= 3 milliseconds
99.97% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
67204.30 requests per second

====== SET ======
  100000 requests completed in 1.30 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

81.09% <= 1 milliseconds
97.16% <= 2 milliseconds
99.43% <= 3 milliseconds
99.75% <= 4 milliseconds
99.80% <= 5 milliseconds
99.82% <= 7 milliseconds
99.83% <= 8 milliseconds
99.85% <= 9 milliseconds
99.87% <= 10 milliseconds
99.89% <= 11 milliseconds
99.89% <= 12 milliseconds
99.90% <= 13 milliseconds
99.90% <= 14 milliseconds
99.90% <= 15 milliseconds
99.91% <= 16 milliseconds
99.93% <= 17 milliseconds
99.94% <= 18 milliseconds
99.95% <= 19 milliseconds
99.96% <= 20 milliseconds
99.98% <= 21 milliseconds
99.99% <= 22 milliseconds
100.00% <= 23 milliseconds
100.00% <= 23 milliseconds
76687.12 requests per second

====== GET ======
  100000 requests completed in 1.91 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

49.74% <= 1 milliseconds
93.92% <= 2 milliseconds
99.37% <= 3 milliseconds
99.95% <= 4 milliseconds
99.97% <= 5 milliseconds
99.98% <= 6 milliseconds
100.00% <= 6 milliseconds
52273.91 requests per second

====== INCR ======
  100000 requests completed in 1.60 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

66.32% <= 1 milliseconds
96.55% <= 2 milliseconds
99.61% <= 3 milliseconds
99.96% <= 4 milliseconds
100.00% <= 5 milliseconds
62344.14 requests per second

====== LPUSH ======
  100000 requests completed in 1.27 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

73.84% <= 1 milliseconds
95.61% <= 2 milliseconds
99.36% <= 3 milliseconds
99.96% <= 4 milliseconds
99.99% <= 5 milliseconds
100.00% <= 5 milliseconds
78492.93 requests per second

====== RPUSH ======
  100000 requests completed in 1.31 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

80.47% <= 1 milliseconds
96.93% <= 2 milliseconds
99.56% <= 3 milliseconds
99.98% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
76103.50 requests per second

====== LPOP ======
  100000 requests completed in 1.30 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

74.91% <= 1 milliseconds
95.50% <= 2 milliseconds
99.29% <= 3 milliseconds
99.95% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
77101.00 requests per second

====== RPOP ======
  100000 requests completed in 1.40 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

77.99% <= 1 milliseconds
97.07% <= 2 milliseconds
99.61% <= 3 milliseconds
99.97% <= 4 milliseconds
99.98% <= 5 milliseconds
100.00% <= 6 milliseconds
100.00% <= 6 milliseconds
71377.59 requests per second

====== SADD ======
  100000 requests completed in 1.32 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

80.83% <= 1 milliseconds
97.14% <= 2 milliseconds
99.57% <= 3 milliseconds
99.95% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
75757.57 requests per second

====== HSET ======
  100000 requests completed in 1.30 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

80.25% <= 1 milliseconds
96.83% <= 2 milliseconds
99.49% <= 3 milliseconds
99.97% <= 4 milliseconds
100.00% <= 4 milliseconds
76923.08 requests per second

====== SPOP ======
  100000 requests completed in 1.48 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

73.97% <= 1 milliseconds
96.91% <= 2 milliseconds
99.55% <= 3 milliseconds
99.96% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
67567.57 requests per second

====== LPUSH (needed to benchmark LRANGE) ======
  100000 requests completed in 1.35 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

71.03% <= 1 milliseconds
95.36% <= 2 milliseconds
99.29% <= 3 milliseconds
99.97% <= 4 milliseconds
100.00% <= 5 milliseconds
100.00% <= 5 milliseconds
73909.83 requests per second

====== LRANGE_100 (first 100 elements) ======
  100000 requests completed in 2.91 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

14.30% <= 1 milliseconds
80.30% <= 2 milliseconds
94.42% <= 3 milliseconds
96.88% <= 4 milliseconds
98.34% <= 5 milliseconds
99.39% <= 6 milliseconds
99.78% <= 7 milliseconds
99.93% <= 8 milliseconds
99.97% <= 9 milliseconds
99.98% <= 10 milliseconds
100.00% <= 11 milliseconds
100.00% <= 11 milliseconds
34317.09 requests per second

====== LRANGE_300 (first 300 elements) ======
  100000 requests completed in 5.88 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

0.00% <= 2 milliseconds
85.83% <= 3 milliseconds
94.17% <= 4 milliseconds
96.10% <= 5 milliseconds
97.90% <= 6 milliseconds
98.68% <= 7 milliseconds
98.70% <= 8 milliseconds
99.30% <= 9 milliseconds
99.49% <= 10 milliseconds
99.76% <= 11 milliseconds
99.79% <= 12 milliseconds
99.83% <= 13 milliseconds
99.85% <= 14 milliseconds
99.87% <= 15 milliseconds
99.89% <= 16 milliseconds
99.91% <= 17 milliseconds
99.92% <= 19 milliseconds
99.93% <= 20 milliseconds
99.94% <= 21 milliseconds
99.95% <= 22 milliseconds
99.96% <= 23 milliseconds
99.97% <= 24 milliseconds
99.99% <= 25 milliseconds
99.99% <= 26 milliseconds
100.00% <= 27 milliseconds
17006.80 requests per second

====== LRANGE_500 (first 450 elements) ======
  100000 requests completed in 8.16 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

0.00% <= 2 milliseconds
0.01% <= 3 milliseconds
80.98% <= 4 milliseconds
90.89% <= 5 milliseconds
95.60% <= 6 milliseconds
97.20% <= 7 milliseconds
98.23% <= 8 milliseconds
98.53% <= 9 milliseconds
99.06% <= 10 milliseconds
99.09% <= 11 milliseconds
99.46% <= 12 milliseconds
99.53% <= 13 milliseconds
99.65% <= 14 milliseconds
99.75% <= 15 milliseconds
99.79% <= 16 milliseconds
99.81% <= 17 milliseconds
99.82% <= 18 milliseconds
99.84% <= 19 milliseconds
99.85% <= 20 milliseconds
99.86% <= 21 milliseconds
99.87% <= 22 milliseconds
99.88% <= 23 milliseconds
99.89% <= 24 milliseconds
99.90% <= 25 milliseconds
99.91% <= 26 milliseconds
99.93% <= 27 milliseconds
99.93% <= 28 milliseconds
99.94% <= 29 milliseconds
99.95% <= 30 milliseconds
99.96% <= 31 milliseconds
99.98% <= 32 milliseconds
99.98% <= 33 milliseconds
99.99% <= 34 milliseconds
99.99% <= 35 milliseconds
100.00% <= 36 milliseconds
100.00% <= 36 milliseconds
12260.91 requests per second

====== LRANGE_600 (first 600 elements) ======
  100000 requests completed in 10.15 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

0.00% <= 3 milliseconds
0.01% <= 4 milliseconds
84.84% <= 5 milliseconds
93.41% <= 6 milliseconds
96.43% <= 7 milliseconds
97.71% <= 8 milliseconds
97.75% <= 9 milliseconds
98.32% <= 10 milliseconds
98.79% <= 11 milliseconds
99.19% <= 12 milliseconds
99.22% <= 13 milliseconds
99.25% <= 14 milliseconds
99.48% <= 15 milliseconds
99.56% <= 16 milliseconds
99.60% <= 17 milliseconds
99.68% <= 18 milliseconds
99.74% <= 19 milliseconds
99.77% <= 20 milliseconds
99.79% <= 21 milliseconds
99.82% <= 22 milliseconds
99.83% <= 23 milliseconds
99.85% <= 24 milliseconds
99.86% <= 25 milliseconds
99.86% <= 26 milliseconds
99.87% <= 27 milliseconds
99.88% <= 28 milliseconds
99.89% <= 29 milliseconds
99.90% <= 30 milliseconds
99.90% <= 31 milliseconds
99.91% <= 32 milliseconds
99.91% <= 33 milliseconds
99.92% <= 34 milliseconds
99.94% <= 35 milliseconds
99.95% <= 36 milliseconds
99.95% <= 37 milliseconds
99.96% <= 38 milliseconds
99.96% <= 39 milliseconds
99.96% <= 40 milliseconds
99.97% <= 41 milliseconds
99.98% <= 42 milliseconds
99.98% <= 43 milliseconds
99.99% <= 44 milliseconds
99.99% <= 45 milliseconds
99.99% <= 46 milliseconds
100.00% <= 47 milliseconds
100.00% <= 47 milliseconds
9851.25 requests per second

====== MSET (10 keys) ======
  100000 requests completed in 1.89 seconds
  100 parallel clients
  3 bytes payload
  keep alive: 1

0.00% <= 1 milliseconds
75.00% <= 2 milliseconds
89.85% <= 3 milliseconds
95.38% <= 4 milliseconds
98.52% <= 5 milliseconds
99.34% <= 6 milliseconds
99.60% <= 7 milliseconds
99.83% <= 8 milliseconds
99.98% <= 9 milliseconds
100.00% <= 9 milliseconds
52994.17 requests per second


[root@redis-server ~]# 
redis-benchmark -h localhost -p 6379 -c 100 -n 100000 

[root@redis-server ~]# redis-benchmark -h localhost -p 6379 -c 100 -n 100000 ====== PING_INLINE ======requests completed in 1.29 secondsparallel clientsbytes payload keep alive: 181.97% = 1 milliseconds97.69% = 2 milliseconds99.79% = 3 milliseconds99.94% = 4 milliseconds99.97% = 5 milliseconds100.00% = 5 milliseconds77639.75 requests per second====== PING_BULK ======requests completed in 1.49 secondsparallel clientsbytes payload keep alive: 173.04% = 1 milliseconds97.46% = 2 milliseconds99.62% = 3 milliseconds99.97% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds67204.30 requests per second====== SET ======requests completed in 1.30 secondsparallel clientsbytes payload keep alive: 181.09% = 1 milliseconds97.16% = 2 milliseconds99.43% = 3 milliseconds99.75% = 4 milliseconds99.80% = 5 milliseconds99.82% = 7 milliseconds99.83% = 8 milliseconds99.85% = 9 milliseconds99.87% = 10 milliseconds99.89% = 11 milliseconds99.89% = 12 milliseconds99.90% = 13 milliseconds99.90% = 14 milliseconds99.90% = 15 milliseconds99.91% = 16 milliseconds99.93% = 17 milliseconds99.94% = 18 milliseconds99.95% = 19 milliseconds99.96% = 20 milliseconds99.98% = 21 milliseconds99.99% = 22 milliseconds100.00% = 23 milliseconds100.00% = 23 milliseconds76687.12 requests per second====== GET ======requests completed in 1.91 secondsparallel clientsbytes payload keep alive: 149.74% = 1 milliseconds93.92% = 2 milliseconds99.37% = 3 milliseconds99.95% = 4 milliseconds99.97% = 5 milliseconds99.98% = 6 milliseconds100.00% = 6 milliseconds52273.91 requests per second====== INCR ======requests completed in 1.60 secondsparallel clientsbytes payload keep alive: 166.32% = 1 milliseconds96.55% = 2 milliseconds99.61% = 3 milliseconds99.96% = 4 milliseconds100.00% = 5 milliseconds62344.14 requests per second====== LPUSH ======requests completed in 1.27 secondsparallel clientsbytes payload keep alive: 173.84% = 1 milliseconds95.61% = 2 milliseconds99.36% = 3 milliseconds99.96% = 4 milliseconds99.99% = 5 milliseconds100.00% = 5 milliseconds78492.93 requests per second====== RPUSH ======requests completed in 1.31 secondsparallel clientsbytes payload keep alive: 180.47% = 1 milliseconds96.93% = 2 milliseconds99.56% = 3 milliseconds99.98% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds76103.50 requests per second====== LPOP ======requests completed in 1.30 secondsparallel clientsbytes payload keep alive: 174.91% = 1 milliseconds95.50% = 2 milliseconds99.29% = 3 milliseconds99.95% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds77101.00 requests per second====== RPOP ======requests completed in 1.40 secondsparallel clientsbytes payload keep alive: 177.99% = 1 milliseconds97.07% = 2 milliseconds99.61% = 3 milliseconds99.97% = 4 milliseconds99.98% = 5 milliseconds100.00% = 6 milliseconds100.00% = 6 milliseconds71377.59 requests per second====== SADD ======requests completed in 1.32 secondsparallel clientsbytes payload keep alive: 180.83% = 1 milliseconds97.14% = 2 milliseconds99.57% = 3 milliseconds99.95% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds75757.57 requests per second====== HSET ======requests completed in 1.30 secondsparallel clientsbytes payload keep alive: 180.25% = 1 milliseconds96.83% = 2 milliseconds99.49% = 3 milliseconds99.97% = 4 milliseconds100.00% = 4 milliseconds76923.08 requests per second====== SPOP ======requests completed in 1.48 secondsparallel clientsbytes payload keep alive: 173.97% = 1 milliseconds96.91% = 2 milliseconds99.55% = 3 milliseconds99.96% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds67567.57 requests per second====== LPUSH (needed to benchmark LRANGE) ======requests completed in 1.35 secondsparallel clientsbytes payload keep alive: 171.03% = 1 milliseconds95.36% = 2 milliseconds99.29% = 3 milliseconds99.97% = 4 milliseconds100.00% = 5 milliseconds100.00% = 5 milliseconds73909.83 requests per second====== LRANGE_100 (first 100 elements) ======requests completed in 2.91 secondsparallel clientsbytes payload keep alive: 114.30% = 1 milliseconds80.30% = 2 milliseconds94.42% = 3 milliseconds96.88% = 4 milliseconds98.34% = 5 milliseconds99.39% = 6 milliseconds99.78% = 7 milliseconds99.93% = 8 milliseconds99.97% = 9 milliseconds99.98% = 10 milliseconds100.00% = 11 milliseconds100.00% = 11 milliseconds34317.09 requests per second====== LRANGE_300 (first 300 elements) ======requests completed in 5.88 secondsparallel clientsbytes payload keep alive: 10.00% = 2 milliseconds85.83% = 3 milliseconds94.17% = 4 milliseconds96.10% = 5 milliseconds97.90% = 6 milliseconds98.68% = 7 milliseconds98.70% = 8 milliseconds99.30% = 9 milliseconds99.49% = 10 milliseconds99.76% = 11 milliseconds99.79% = 12 milliseconds99.83% = 13 milliseconds99.85% = 14 milliseconds99.87% = 15 milliseconds99.89% = 16 milliseconds99.91% = 17 milliseconds99.92% = 19 milliseconds99.93% = 20 milliseconds99.94% = 21 milliseconds99.95% = 22 milliseconds99.96% = 23 milliseconds99.97% = 24 milliseconds99.99% = 25 milliseconds99.99% = 26 milliseconds100.00% = 27 milliseconds17006.80 requests per second====== LRANGE_500 (first 450 elements) ======requests completed in 8.16 secondsparallel clientsbytes payload keep alive: 10.00% = 2 milliseconds0.01% = 3 milliseconds80.98% = 4 milliseconds90.89% = 5 milliseconds95.60% = 6 milliseconds97.20% = 7 milliseconds98.23% = 8 milliseconds98.53% = 9 milliseconds99.06% = 10 milliseconds99.09% = 11 milliseconds99.46% = 12 milliseconds99.53% = 13 milliseconds99.65% = 14 milliseconds99.75% = 15 milliseconds99.79% = 16 milliseconds99.81% = 17 milliseconds99.82% = 18 milliseconds99.84% = 19 milliseconds99.85% = 20 milliseconds99.86% = 21 milliseconds99.87% = 22 milliseconds99.88% = 23 milliseconds99.89% = 24 milliseconds99.90% = 25 milliseconds99.91% = 26 milliseconds99.93% = 27 milliseconds99.93% = 28 milliseconds99.94% = 29 milliseconds99.95% = 30 milliseconds99.96% = 31 milliseconds99.98% = 32 milliseconds99.98% = 33 milliseconds99.99% = 34 milliseconds99.99% = 35 milliseconds100.00% = 36 milliseconds100.00% = 36 milliseconds12260.91 requests per second====== LRANGE_600 (first 600 elements) ======requests completed in 10.15 secondsparallel clientsbytes payload keep alive: 10.00% = 3 milliseconds0.01% = 4 milliseconds84.84% = 5 milliseconds93.41% = 6 milliseconds96.43% = 7 milliseconds97.71% = 8 milliseconds97.75% = 9 milliseconds98.32% = 10 milliseconds98.79% = 11 milliseconds99.19% = 12 milliseconds99.22% = 13 milliseconds99.25% = 14 milliseconds99.48% = 15 milliseconds99.56% = 16 milliseconds99.60% = 17 milliseconds99.68% = 18 milliseconds99.74% = 19 milliseconds99.77% = 20 milliseconds99.79% = 21 milliseconds99.82% = 22 milliseconds99.83% = 23 milliseconds99.85% = 24 milliseconds99.86% = 25 milliseconds99.86% = 26 milliseconds99.87% = 27 milliseconds99.88% = 28 milliseconds99.89% = 29 milliseconds99.90% = 30 milliseconds99.90% = 31 milliseconds99.91% = 32 milliseconds99.91% = 33 milliseconds99.92% = 34 milliseconds99.94% = 35 milliseconds99.95% = 36 milliseconds99.95% = 37 milliseconds99.96% = 38 milliseconds99.96% = 39 milliseconds99.96% = 40 milliseconds99.97% = 41 milliseconds99.98% = 42 milliseconds99.98% = 43 milliseconds99.99% = 44 milliseconds99.99% = 45 milliseconds99.99% = 46 milliseconds100.00% = 47 milliseconds100.00% = 47 milliseconds9851.25 requests per second====== MSET (10 keys) ======requests completed in 1.89 secondsparallel clientsbytes payload keep alive: 10.00% = 1 milliseconds75.00% = 2 milliseconds89.85% = 3 milliseconds95.38% = 4 milliseconds98.52% = 5 milliseconds99.34% = 6 milliseconds99.60% = 7 milliseconds99.83% = 8 milliseconds99.98% = 9 milliseconds100.00% = 9 milliseconds52994.17 requests per second[root@redis-server ~]#

View Code

2、redis-cli

2、redis-cli 

例1:监控本机6379端口的实例的数据操作,redis的连接及读写操作

例1:监控本机6379端口的实例的数据操作,redis的连接及读写操作

redis-cli -h localhost -p 6379 monitor 
redis-cli -h localhost -p 6379 monitor 

本文由js12345金沙官网登入发布于网络编程,转载请注明出处:关于redis状态监控和性能调优详解js12345金沙官网

关键词: