• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答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
    主站蜘蛛池模板: 日本精品久久久久中文字幕8| 国产一区二区三精品久久久无广告 | 伊人久久无码精品中文字幕| 欧美一区二区精品久久| 欧美亚洲国产成人精品| 国产精品主播一区二区| 国产精品久久久天天影视香蕉 | 日韩精品无码一区二区三区| 国产亚洲精品无码专区| 奇米精品一区二区三区在线观看| 国产精品多p对白交换绿帽| 人妻少妇偷人精品无码| 中文字幕精品亚洲无线码二区| 无码欧精品亚洲日韩一区| 国产精品亚洲不卡一区二区三区| 成人国产精品一区二区网站| 精品无码国产一区二区三区51安 | 国内精品久久久久久久久电影网| 日本人精品video黑人| 国产成人精品日本亚洲专一区| 久久精品黄AA片一区二区三区| 中国大陆精品视频XXXX| 精品日本一区二区三区在线观看| 国产成人高清精品一区二区三区| 久久99精品国产麻豆宅宅| 91麻豆精品国产自产在线观看一区 | 亚洲av永久无码精品表情包| 欧美激情视频精品一区二区 | 国产成人精品免费视频网页大全 | 日韩精品无码免费一区二区三区| 亚洲精品久久久www| 亚洲国产精品激情在线观看| 亚洲精品成a人在线观看| 亚洲欧洲久久久精品| 亚洲综合精品网站在线观看| 亚洲а∨天堂久久精品9966| 四虎国产精品永久在线看| 亚洲AV无码成人精品区狼人影院 | 无码国产亚洲日韩国精品视频一区二区三区 | 精品久久人人妻人人做精品 | 国产精品成人va在线观看|