国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

Redis常用命令解析INFO,MONITOR,SLOWLOG

來源:懂視網 責編:小采 時間:2020-11-09 14:14:08
文檔

Redis常用命令解析INFO,MONITOR,SLOWLOG

Redis常用命令解析INFO,MONITOR,SLOWLOG:作者:zhanhailiang 日期:2014-12-02 1. INFO info指令返回服務器相關信息,包括: server: General information about the Redis server clients: Client connections section memory: Memory consumpti
推薦度:
導讀Redis常用命令解析INFO,MONITOR,SLOWLOG:作者:zhanhailiang 日期:2014-12-02 1. INFO info指令返回服務器相關信息,包括: server: General information about the Redis server clients: Client connections section memory: Memory consumpti

作者:zhanhailiang 日期:2014-12-02 1. INFO info指令返回服務器相關信息,包括: server: General information about the Redis server clients: Client connections section memory: Memory consumption related information persistence: RDB and AOF r

 作者:zhanhailiang 日期:2014-12-02

1. INFO

info指令返回服務器相關信息,包括:

  • server: General information about the Redis server
  • clients: Client connections section
  • memory: Memory consumption related information
  • persistence: RDB and AOF related information
  • stats: General statistics
  • replication: Master/slave replication information
  • cpu: CPU consumption statistics
  • commandstats: Redis command statistics
  • cluster: Redis Cluster section
  • keyspace: Database related statistics

    其本身支持定制返回列表:

    [root@~]# redis-cli info
    [root@~]# redis-cli info default
    [root@~]# redis-cli info all

    詳情請見:http://www.redis.cn/commands/info.html

    2. MONITOR

    MONITOR是一個調試命令,返回服務器處理的每一個命令,它能幫助我們了解在數據庫上發生了什么操作。共有3種操作方法:

    [root@~]# redis-cli monitor
    OK
    1417532512.619715 [0 127.0.0.1:55043] "REPLCONF" "ACK" "6623624"
    [root@~]# telnet 127.0.0.1 6379
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
    Escape character is '^]'.
    monitor
    +OK
    +1417532567.733458 [0 127.0.0.1:55043] "REPLCONF" "ACK" "6623708"
    +1417532568.735936 [0 127.0.0.1:55043] "REPLCONF" "ACK" "6623708"
    quit
    +OK
    Connection closed by foreign host.
    [root@~]# redis-cli 
    127.0.0.1:6379> monitor
    OK
    1417532590.785487 [0 127.0.0.1:55043] "REPLCONF" "ACK" "6623736"

    由于MONITOR命令返回服務器處理的所有的命令, 所以在性能上會有一些消耗。使用官方的壓測工具測試結果如下

    在不運行MONITOR命令的情況下,benchmark的測試結果:

    [root@~/software/redis-2.8.17]# src/redis-benchmark -c 10 -n 100000 -q
    PING_INLINE: 51020.41 requests per second
    PING_BULK: 50607.29 requests per second
    SET: 37257.82 requests per second
    GET: 49800.80 requests per second
    INCR: 38699.69 requests per second
    LPUSH: 38910.51 requests per second
    LPOP: 39277.30 requests per second
    SADD: 54614.96 requests per second
    SPOP: 51948.05 requests per second
    LPUSH (needed to benchmark LRANGE): 38819.88 requests per second
    LRANGE_100 (first 100 elements): 20112.63 requests per second
    LRANGE_300 (first 300 elements): 9025.27 requests per second
    LRANGE_500 (first 450 elements): 6836.67 requests per second
    LRANGE_600 (first 600 elements): 5406.28 requests per second
    MSET (10 keys): 19394.88 requests per second

    在運行MONITOR命令的情況下,benchmark的測試結果: (redis-cli monitor > /dev/null):

    [root@~/software/redis-2.8.17]# src/redis-benchmark -c 10 -n 100000 -q
    PING_INLINE: 42211.91 requests per second
    PING_BULK: 42936.88 requests per second
    SET: 26143.79 requests per second
    GET: 33990.48 requests per second
    INCR: 26553.37 requests per second
    LPUSH: 27337.34 requests per second
    LPOP: 27225.70 requests per second
    SADD: 30459.95 requests per second
    SPOP: 39494.47 requests per second
    LPUSH (needed to benchmark LRANGE): 26315.79 requests per second
    LRANGE_100 (first 100 elements): 22055.58 requests per second
    LRANGE_300 (first 300 elements): 8104.38 requests per second
    LRANGE_500 (first 450 elements): 6371.05 requests per second
    LRANGE_600 (first 600 elements): 5031.95 requests per second
    MSET (10 keys): 14861.05 requests per second

    可以看到各項指標基本都有所下降。

    詳情請見:http://www.redis.cn/commands/monitor.html

    3. SLOWLOG

    通過SLOWLOG可以讀取慢查詢日志。

    使用SLOWLOG LEN就可以獲取當前慢日志長度。

    [root@~/software/redis-2.8.17]# redis-cli 
    127.0.0.1:6379> slowlog len
    (integer) 28

    使用SLOWLOG GET就可以獲取所有慢日志。

    127.0.0.1:6379> slowlog get 
     1) 1) (integer) 27
     2) (integer) 1417531320
     3) (integer) 24623
     4) 1) "info"

    其中,各項指標表示:

  • A unique progressive identifier for every slow log entry.
  • The unix timestamp at which the logged command was processed.
  • The amount of time needed for its execution, in microseconds(注意,microseconds翻譯成微秒,而不是毫秒).
  • The array composing the arguments of the command.

    使用SLOWLOG GET N就可以獲取最近N條慢日志。

    127.0.0.1:6379> slowlog get 2
    1) 1) (integer) 27
     2) (integer) 1417531320
     3) (integer) 24623
     4) 1) "info"
    2) 1) (integer) 26
     2) (integer) 1417528379
     3) (integer) 21363
     4) 1) "get"
     2) "user:score"

    使用SLOWLOG RESET命令重置慢日志。一旦執行,將丟失以前的所有慢日志。

    127.0.0.1:6379> slowlog reset
  • 聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    Redis常用命令解析INFO,MONITOR,SLOWLOG

    Redis常用命令解析INFO,MONITOR,SLOWLOG:作者:zhanhailiang 日期:2014-12-02 1. INFO info指令返回服務器相關信息,包括: server: General information about the Redis server clients: Client connections section memory: Memory consumpti
    推薦度:
    標簽: 常用 re 解析
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 亚洲欧洲国产成人综合一本 | 成人一级免费视频 | 国产v欧美v日韩在线观看 | 亚洲欧美日韩国产综合 | 亚洲欧美日韩精品永久在线 | 在线视频你懂 | 青春草国产 | 国产日韩欧美第一页 | 国产精选在线视频 | 日韩在线电影 | 欧美日韩网 | 伊人情人综合成人久久网小说 | 亚洲精品一二三四区 | 青青操国产视频 | 91在线高清 | 欧美日韩亚洲一区二区三区在线观看 | 精品国产免费人成在线观看 | 国产欧美成人一区二区三区 | 欧美第一页在线观看 | 国产精品一区二区免费 | 欧美高清不卡 | 亚洲乱码一二三四区麻豆 | 激情另类国内一区二区视频 | 性欧美大战久久久久久久野外 | 乌克兰性欧美精品高清bd | 小说区 亚洲 自拍 另类 | 国产高清美女一级毛片久久 | 国产一区二区三区在线 | 国产精品黄大片在线播放 | 毛片一级免费 | 国产在线精品成人一区二区三区 | 亚洲欧洲日产国码一级毛片 | 日本国产一区 | 永久在线毛片免费观看 | 日本黄 色 成 年 人免费观看 | 国产一级毛片在线 | 日本a中文字幕 | 国产成人a一区二区 | 五月婷婷在线视频 | 国产免费资源高清小视频在线观看 | a国产|