標籤:ann max 發送 member 時間 指定 cli body 參數
-x 從標準輸入讀取一個參數
such as:
echo –en “shaw” |./redis-cli –x setname == set name shaw
-r 重複執行一個命令指定的次數
-i 設定命令執行的間隔
such as:
12345 |
[[email protected]_Redis1 src] # ./redis-cli -r 100 -i 1 info | grep total_commands_processed # 每隔1秒執行一次,共執行100次info命令 total_commands_processed:140 total_commands_processed:141 total_commands_processed:142 total_commands_processed:143 |
--rdb 擷取指定redis執行個體的rdb檔案,儲存到本地
例如:
123 |
[[email protected]_Redis1 src] # ./redis-cli --rdb /home/tools/6379.rdb SYNC sent to master, writing 31 bytes to ‘/home/tools/6379.rdb‘ Transfer finished with success. |
--scan 利用scan命令掃描列出redis中的key
--pattern 指定掃描的key的pattern,相比keys pattern模式,不會長時間阻塞redis而導致其他用戶端的命令請求一直處於阻塞狀態
例如:
12 |
[[email protected]_Redis1 src] # ./redis-cli --scan --pattern ‘na*‘ name |
-h 指定被連結的ip
-p 指定串連連接埠
-a 指定串連的使用者的密碼,也可以串連完成後,用auth命令完成授權
-s 只有用戶端和服務端在同一個機器,可以通過unix socket方式串連
--stat 擷取redis的診斷資料
例如:
1234567 |
[[email protected]_Redis1 src] # ./redis-cli --stat ------- data ------ --------------------- load -------------------- - child - keys mem clients blocked requests connections 1 1.78M 1 0 169 (+0) 22 1 1.78M 1 0 170 (+1) 22 1 1.78M 1 0 171 (+1) 22 1 1.78M 1 0 172 (+1) 22 |
--pipe 發送原始的redis protocl格式資料到伺服器端執行
--bigkeys 對redis中的key進行採樣,尋找較大的keys,還能根據採樣得出大概的資料統計
例如:
12345678910111213141516 |
[[email protected]_Redis1 src] # ./redis-cli --bigkeys # Scanning the entire keyspace to find biggest keys as well as # average sizes per key type. You can use -i 0.1 to sleep 0.1 sec # per 100 SCAN commands (not usually needed). [00.00%] Biggest string found so far ‘name‘ with 4 bytes -------- summary ------- Sampled 1 keys in the keyspace! Total key length in bytes is 4 (avg len 4.00) Biggest string found ‘name‘ has 4 bytes 1 strings with 4 bytes (100.00% of keys, avg size 4.00) 0 lists with 0 items (00.00% of keys, avg size 0.00) 0 sets with 0 members (00.00% of keys, avg size 0.00) 0 hashs with 0 fields (00.00% of keys, avg size 0.00) 0 zsets with 0 members (00.00% of keys, avg size 0.00) |
--latency 擷取到命令的請求時間,包括(min,max,avg)
待補充完善。。。
Redis第二篇(Redis基本命令)