小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

redis常用性能分析命令

 WindySky 2018-02-07

一、連接

1
2
3
4
5
src/redis-cli -h 10.20.137.141 -p 6379
>auth 123456789
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789
src/redis-cli -h {ip} -p {port} -a {password} monitor

二、常用性能分析命令

1
2
3
4
5
6
7
8
9
10
11
12
13
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 monitor
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789  info clients|grep connected_clients 查看客戶端已連接個數(shù)
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|egrep '(used_memory_human|used_memory_peak_human)' 
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|grep  -e "used_memory_human" -e "used_memory_peak_human"  查看當(dāng)前使用內(nèi)存量和歷史最高峰值
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep total_commands 查看啟動到當(dāng)前處理命令總數(shù)
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep instantaneous_ops_per_sec 每秒操作數(shù)
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep expired_keys 已過期的key數(shù)量
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep instantaneous_input_kbps 每秒進(jìn)出流量(70444byte)0.07M
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info stats | grep rejected_connections拒絕的連接請求量
src/redis-cli -h 10.20.137.141 -p 6379 -a 123456789 info memory|grep mem_fragmentation_ratio
內(nèi)存碎片比例(如果超過1,表示存在內(nèi)存碎片;如果小于1,說明內(nèi)存被交換到swap里面去了。計算公式為:used_memory_rss/used_memory)
src/redis-cli -h IP -p 26379 -a 123456 info|grep process_id
src/redis-cli info clients|grep connected_clients 查看客戶端已連接個數(shù)

三、動態(tài)修改保存方式

1
2
3
config set save ""  不持久化
config rewrite
config get save

 四、latency命令報告

   latency latest記錄最后的延遲事件記錄,每個事件包含以下幾個變量(事件名、事件延遲狀態(tài)時間戳、延遲時間ms、此時間最大延遲)

 注意:Unix時間戳轉(zhuǎn)換方式為:

1
2
date -d@'1466059344' "+ %Y-%m-%d %H:%M:%S"
date -d"2016-06-16 16:50:50" '+%s'

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
127.0.0.1:6379>latency latest
1)"command"                    事件類型
2)(integer) 1466059344    發(fā)生時間
3)(integer) 250                 延遲時間0.25ms
4)(integer)1000               事件延遲最大時間為1s
127.0.0.1:6379>history events 此命令可以打印相應(yīng)延遲事件相關(guān)的時間和耗時
127.0.0.1:6379>latency  reset command重置事件的相關(guān)延遲操作,清空記錄
127.0.0.1:6379>latency  graph command  
127.0.0.1:6379>slowlog get 獲取慢查詢?nèi)罩?/code>
127.0.0.1:6379>slowlog len 獲取慢查詢?nèi)罩緱l數(shù)
127.0.0.1:6379>slowlog reset 清空慢查詢
127.0.0.1:6379>config get maxclients查看最大連接數(shù)配置

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多