使用Redis-Cli了解延迟 [英] Understanding latency using Redis-Cli

查看:285
本文介绍了使用Redis-Cli了解延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用redis-cli工具观察redis服务器的延迟.这是一个示例:

I'm using the redis-cli tool to observe redis-server latency. Here's an example:

ubuntu:~$ redis-cli --latency -h 127.0.0.1 -p 6379
min: 0, max: 15, avg: 0.12 (2839 samples)

问题是,这些值实际上是什么意思?我正在努力寻找有关此工具的文档,而不是该工具自己的帮助文档所能提供的.

Question is, what these values actually mean? I'm struggling to find documentation on this beyond what's available through the tool's own help document.

推荐答案

redis-cli --latency -h -p命令是一个工具,可帮助解决和了解您可能在Redis上遇到的延迟问题.通过测量Redis服务器响应Redis PING命令的时间(以毫秒为单位)来实现.

The redis-cli --latency -h -p command is a tool that helps troubleshoot and understand latency problems you maybe experiencing with Redis. It does so by measuring the time for the Redis server to respond to the Redis PING command in milliseconds.

在这种情况下,延迟是客户端之间的最大延迟时间 发出命令以及命令接收答复的时间 客户端.通常Redis的处理时间极短,在 微秒范围,但在某些情况下会导致更高的范围 延迟数字.

In this context latency is the maximum delay between the time a client issues a command and the time the reply to the command is received by the client. Usually Redis processing time is extremely low, in the sub microsecond range, but there are certain conditions leading to higher latency figures.

- Redis延迟问题疑难解答

因此,当我们运行命令redis-cli --latency -h 127.0.0.1 -p 6379时,Redis会进入一种特殊模式,在该模式下,它会(通过运行PING)连续采样延迟.

So when we ran the command redis-cli --latency -h 127.0.0.1 -p 6379 Redis enters into a special mode in which it continuously samples latency (by running PING).

现在让我们细分返回的数据:min: 0, max: 15, avg: 0.12 (2839 samples)

Now let's breakdown that data it returns: min: 0, max: 15, avg: 0.12 (2839 samples)

什么是(2839 samples)??这是redis-cli记录的发出PING命令和接收响应的次数.换句话说,这是您的样本数据.在我们的示例中,我们记录了2839个请求和响应.

What's (2839 samples)? This is the amount of times the redis-cli recorded issuing the PING command and receiving a response. In other words, this is your sample data. In our example we recorded 2839 requests and responses.

什么是min: 0??min值表示CLI发出PING的时间与收到回复之间的最小延迟.换句话说,这是我们采样数据中绝对最佳的响应时间.

What's min: 0? The min value represents the minimum delay between the time the CLI issued PING and the time the reply was received. In other words, this was the absolute best response time from our sampled data.

什么是max: 15?.max值与min相反.它表示CLI发出PING的时间与收到对命令的答复之间的最大延迟.这是我们采样数据中最长的响应时间.在我们的2839个样本示例中,最长的交易花费了15ms.

What's max: 15? The max value is the opposite of min. It represents the maximum delay between the time the CLI issued PING and the time the reply to the command was received. This is the longest response time from our sampled data. In our example of 2839 samples, the longest transaction took 15ms.

什么是avg: 0.12??avg值是所有采样数据的平均响应时间(以毫秒为单位).因此,平均而言,我们2839个样本中的响应时间为0.12ms.

What's avg: 0.12? The avg value is the average response time in milliseconds for all our sampled data. So on average, from our 2839 samples the response time took 0.12ms.

基本上,minmaxavg的较大数字是一件坏事.

Basically, higher numbers for min, max, and avg is a bad thing.

有关如何使用此数据的一些很好的后续材料:

  • Redis latency problems troubleshooting
  • Redis latency monitoring framework
  • How fast is Redis?
  • Redis Performance Thoughts

这篇关于使用Redis-Cli了解延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆