?
This document uses PHP Chinese website manual Release
CLIENT LIST
自2.4.0起可用。
時間復(fù)雜度: O(N)其中 N 是客戶端連接數(shù)
CLIENT LIST 命令以大多數(shù)人可讀的格式返回有關(guān)客戶端連接服務(wù)器的信息和統(tǒng)計信息。
批量字符串回復(fù):唯一字符串,格式如下:
每行一個客戶端連接(由 LF 分隔)
每行由property=value
由空格字符分隔的一系列字段組成。
這里是這些字段的含義:
id
:唯一的64位客戶端 ID(在 Redis 2.8.12 中引入)。
addr
:客戶端的地址/端口
fd
:與套接字對應(yīng)的文件描述符
age
:連接的總持續(xù)時間,以秒為單位
idle
:以秒為單位的連接空閑時間
flags
:客戶端標(biāo)志(見下文)
db
:當(dāng)前數(shù)據(jù)庫 ID
sub
:頻道訂閱的數(shù)量
psub
:模式匹配訂閱的數(shù)量
multi
:MULTI / EXEC 上下文中的命令數(shù)量
qbuf
:查詢緩沖區(qū)長度(0表示沒有待處理的查詢)
qbuf-free
:查詢緩沖區(qū)的空閑空間(0表示緩沖區(qū)已滿)
obl
:輸出緩沖區(qū)長度
oll
:輸出列表長度(當(dāng)緩沖區(qū)已滿時,回復(fù)在此列表中排隊)
omem
:輸出緩沖區(qū)內(nèi)存使用量
events
:文件描述符事件(見下文)
cmd
:播放最后的命令
客戶端標(biāo)志可以是以下的組合:
O: the client is a slave in MONITOR mode S: the client is a normal slave server M: the client is a master x: the client is in a MULTI/EXEC context b: the client is waiting in a blocking operation i: the client is waiting for a VM I/O (deprecated)d: a watched keys has been modified - EXEC will fail c: connection to be closed after writing entire reply u: the client is unblocked U: the client is connected via a Unix domain socket r: the client is in readonly mode against a cluster node A: connection to be closed ASAP N: no specific flag set
文件描述符事件可以是:
r: the client socket is readable (event loop)w: the client socket is writable (event loop)
定期添加新的字段用于調(diào)試目的。將來有些可能會被刪除。使用此命令的版本安全的 Redis 客戶端應(yīng)相應(yīng)地解析輸出(即正確處理丟失的字段,跳過未知字段)。