小白教程
所有教程
关于
Search
172.70.100.142
172.70.100.142
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Server showlog”的源代码
本页内容
上一节:
Server_slaveof
下一节:
Server_sync
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:SLOWLOG subcommand [argument]}}[[Category:redis server|30]] = Redis slowlog 命令 = [[redis server|Redis 服务器]] Redis slowlog 是 Redis 用来记录查询执行时间的日志系统。 查询执行时间指的是不包括像客户端响应(talking)、发送回复等 IO 操作,而单单是执行一个查询命令所耗费的时间。 另外,slow log 保存在内存里面,读写速度非常快,因此你可以放心地使用它,不必担心因为开启 slow log 而损害 Redis 的速度。 === 语法 === redis slowlog 命令基本语法如下: <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> SLOWLOG subcommand [argument] </sample> === 可用版本 === >= 2.2.12 === 返回值 === 取决于不同命令,返回不同的值。 == 查看日志信息: <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> slowlog get 2 1) 1) (integer) 14 2) (integer) 1309448221 3) (integer) 15 4) 1) "ping" 2) 1) (integer) 13 2) (integer) 1309448128 3) (integer) 30 4) 1) "slowlog" 2) "get" 3) "100" </sample> 查看当前日志的数量: <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> SLOWLOG LEN (integer) 14 </sample> 使用命令 SLOWLOG RESET 可以清空 slow log 。 <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> SLOWLOG LEN (integer) 14 redis 127.0.0.1:6379> SLOWLOG RESET OK redis 127.0.0.1:6379> SLOWLOG LEN (integer) 0 </sample> [[redis server|Redis 服务器]]
返回至“
Server showlog
”。
上一节:
Server_slaveof
下一节:
Server_sync