HTML5技术

15天玩转redis —— 第七篇 同事的一次缓存操作引起对慢查询的认识 - 一线码农(2)

字号+ 作者:H5之家 来源:博客园 2015-11-23 14:51 我要评论( )

# The following time is expressed in microseconds, so 1000000 is equivalent# to one second. Note that a negative number disables the slow log, while # a value of zero forces the logging of every comm

# The following time is expressed in microseconds, so 1000000 is equivalent # to one second. Note that a negative number disables the slow log, while # a value of zero forces the logging of every command. slowlog-log-slower-than 0 # There is no limit to this length. Just be aware that it will consume memory. # You can reclaim memory used by the slow log with SLOWLOG RESET. slowlog-max-len 10

 

然后我简单测试一下,所有command都会被记录到slowlog里面去了,下图中的红色框框就是comand的执行时间。

 

有了这个,我现在是不是可以找到所有生产线上哪些慢的command命令呢???这样大家就不会扯皮了。。。最后我们简单看下他们的源码,从源码

中你可以看到其实slowlog是用List实现的,而我们也知道在Redis中List是用“双向链表”实现的。

 

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • 记一次企业级爬虫系统升级改造(六):基于Redis实现免费的IP代理池 - 彩色铅笔

    记一次企业级爬虫系统升级改造(六):基于Redis实现免费的IP代理池

    2017-03-21 09:00

  • Session分布式共享 = Session + Redis + Nginx - 傲翼飞寒

    Session分布式共享 = Session + Redis + Nginx - 傲翼飞寒

    2017-03-10 16:00

  • C# Redis之ServiceStack - 社会主义接班人

    C# Redis之ServiceStack - 社会主义接班人

    2017-03-03 14:00

  • HTML5 Canvas玩转酷炫大波浪进度图 - 【当耐特】

    HTML5 Canvas玩转酷炫大波浪进度图 - 【当耐特】

    2016-12-14 11:01

网友点评
h