Redis monitor命令
MONITOR
MONITOR
- Available since:
- 1.0.0
- Time complexity:
- ACL categories:
@admin,@slow,@dangerous
MONITOR is a debugging command that streams back every command processed by the Redis server. It can help in understanding what is happening to the database. This command can both be used via redis-cli and via telnet.
The ability to see all the requests processed by the server is useful in order to spot bugs in an application both when using Redis as a database and as a distributed caching system.
$ redis-cli monitor
1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
1339518087.877697 [0 127.0.0.1:60866] "dbsize"
1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
1339518096.506257 [0 127.0.0.1:60866] "get" "x"
1339518099.363765 [0 127.0.0.1:60866] "eval" "return redis.call('set','x','7')" "0"
1339518100.363799 [0 lua] "set" "x" "7"
1339518100.544926 [0 127.0.0.1:60866] "del" "x"
Use SIGINT (Ctrl-C) to stop a MONITOR stream running via redis-cli.
$ telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
MONITOR
+OK
+1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
+1339518087.877697 [0 127.0.0.1:60866] "dbsize"
+1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
+1339518096.506257 [0 127.0.0.1:60866] "get" "x"
+1339518099.363765 [0 127.0.0.1:60866] "del" "x"
+1339518100.544926 [0 127.0.0.1:60866] "get" "x"
QUIT
+OK
Connection closed by foreign host.
Manually issue the QUIT or RESET commands to stop a MONITOR stream running via telnet.
Commands not logged by MONITOR
Because of security concerns, no administrative commands are logged by MONITOR's output and sensitive data is redacted in the command AUTH.
Furthermore, the command QUIT is also not logged.
Cost of running MONITOR
Because MONITOR streams back all commands, its use comes at a cost. The following (totally unscientific) benchmark numbers illustrate what the cost of running MONITOR can be.
Benchmark result without MONITOR running:
$ src/redis-benchmark -c 10 -n 100000 -q
PING_INLINE: 101936.80 requests per second
PING_BULK: 102880.66 requests per second
SET: 95419.85 requests per second
GET: 104275.29 requests per second
INCR: 93283.58 requests per second
Benchmark result with MONITOR running (redis-cli monitor > /dev/null):
$ src/redis-benchmark -c 10 -n 100000 -q
PING_INLINE: 58479.53 requests per second
PING_BULK: 59136.61 requests per second
SET: 41823.50 requests per second
GET: 45330.91 requests per second
INCR: 41771.09 requests per second
In this particular case, running a single MONITOR client can reduce the throughput by more than 50%. Running more MONITOR clients will reduce throughput even more.
Return
Non standard return value, just dumps the received commands in an infinite flow.
Behavior change history
>= 6.0.0:AUTHexcluded from the command's output.>= 6.2.0: "RESETcan be called to exit monitor mode.>= 6.2.4: "AUTH,HELLO,EVAL,EVAL_RO,EVALSHAandEVALSHA_ROincluded in the command's output.
Redis monitor命令的更多相关文章
- 通过redis的monitor命令排除故障
项目里有10台服务器都在一个刀箱里,其中一台是redis缓存服务器,另外的是app服务器.通过监控发现这个刀箱的流量750M,其中缓存服务器的流量达105M,这么高的流量已经造成其它项目的服务器网络延 ...
- Redis常用命令解析——INFO, MONITOR, SLOWLOG
1. INFO info指令返回服务器相关信息,包括: server: General information about the Redis server clients: Client conne ...
- Benchmark result without MONITOR running: Benchmark result with MONITOR running (redis-cli monitor > /dev/null): 吞吐量 下降约1半 Redis监控工具,命令和调优
https://redis.io/commands/monitor In this particular case, running a single MONITOR client can reduc ...
- redis shell命令大全
redis shell命令大全(转自http://blog.mkfree.com/posts/5105432f975ad0eb7d135964) 作者:oyhk 2013-1-28 3:11:35 ...
- Redis常用命令手册:服务器相关命令
Redis提供了丰富的命令(command)对数据库和各种数据类型进行操作,这些command可以在Linux终端使用.在编程时,比如各类语言包,这些命令都有对应的方法.下面将Redis提供的命令做一 ...
- Redis监控工具,命令和调优
Redis监控工具,命令和调优 1.图形化监控 因为要对Redis做性能测试,发现了GitHub上有个python写的RedisLive监控工具评价不错.结果鼓捣了半天,最后发现其主页中引用了Goog ...
- 数据库 【redis】 命令大全
以下纯属搬砖,我用Python抓取的redis命令列表页内容 如果想看命令的具体使用可查去官网查看,以下整理为个人查找方便而已 地理位置GEOADD 将指定的地理空间位置(纬度.经度.名称)添加到指定 ...
- 监控 redis 执行命令
监控 redis 执行命令 Intro 最近在用 redis 的时候想看看执行了哪些命令,于是发现了 redis-cli 提供的 Monitor 命令,直接使用这个就可以监控执行的大部分 redis ...
- Redis 基础命令
1. 进入redis目录,启动redis cd src ./redis-server 2. 进入redis目录,启动redis客户端 cd src ./redis-cli 3. info命令 4. ...
- redis 的命令总结
此博客为技术收集和个人的学习积累,如侵犯了您的权益,请联系我,我会及时删除,谢谢 [Redis] redis-cli 命令总结 Redis提供了丰富的命令(command)对数据库和各种数据类型进行操 ...
随机推荐
- Java反射机制清空字符串导致业务异常分析
摘要:笔者在处理业务线问题时遇到接口返回的内容和实际内容不一致的现象. 本文分享自华为云社区<Java反射机制清空字符串导致业务异常分析>,作者:毕昇小助手. 编者按:笔者在处理业务线问题 ...
- 云图说|华为HiLens云上管理平台 花样管理多种端侧设备
摘要:华为HiLens作为端云协同多模态AI开发应用平台,支持对接和管理多种端侧计算设备,帮助用户开发多模态AI应用并下发到端侧设备,实现多场景的智能化解决方案. 本文分享自华为云社区<[云图说 ...
- VEGA:诺亚AutoML高性能开源算法集简介
摘要:VEGA是华为诺亚方舟实验室自研的全流程AutoML算法集合,提供架构搜索.超参优化.数据增强.模型压缩等全流程机器学习自动化基础能力. 本文分享自华为云社区<VEGA:诺亚AutoML高 ...
- Walrus 入门教程:如何创建模板以沉淀可复用的团队最佳实践
模板是 Walrus 的核心功能之一,模板创建完成后用户可以重复使用,并在使用过程中逐渐沉淀研发和运维团队的最佳实践,进一步简化服务及资源的部署.用户可以使用 HCL 语言自定义创建模板,也可以一键复 ...
- Spring 太肥、太慢?你受不了?那 Solon Java Framework 就是你的西施
Solon 是什么? Java 生态型应用开发框架.它从零开始构建,有自己的标准规范与开放生态(历时五年,已有全球第二级别的生态规模).与其他框架相比,它解决了两个重要的痛点:启动慢,费内存.2023 ...
- Solon 拉取 maven 包很慢或拉不了,怎么办?
注意:如果在 IDEA 设置里指定了 settings.xml,下面两个方案可能会失效.(或者直接拿"腾讯" 的镜像仓库地址,按自己的习惯配置) 1.可以在项目的 pom.xml ...
- Nginx log 日志文件较大,按日期生成 实现日志的切割
Nginx日志不处理的话,会一直追加,文件会变得很大,所以理想做法是按天对 Nginx日志进行分割 方法1:给日志文件名加上日期 推荐 log_format access-upstream '$tim ...
- 题解 CF1388A 【Captain Flint and Crew Recruitment】(思维、贪心)
AC代码: #include<bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; if (n ...
- Codeforces Round #690 (Div. 3) (简单题解记录)
Codeforces Round #690 (Div. 3) 1462A. Favorite Sequence 简单看懂题即可,左边输出一个然后右边输出一个. void solve() { int n ...
- java对base64的图片进行压缩
目标:用java将图片的base64码压缩到40kb以下. 依赖 <!-- 压缩图片--> <dependency> <groupId>net.coobird< ...