Browse files

Added CLIENT LIST and CLIENT KILL commands.

  • Loading branch information...
1 parent c4328a8 commit eb48c2e6e206538c5bdd503260d5c4d1efc5cf1e @dspezia dspezia committed Jul 29, 2012
Showing with 92 additions and 0 deletions.
  1. +18 −0 commands.json
  2. +15 −0 commands/client
  3. +59 −0 commands/client
@@ -133,6 +133,24 @@
"since": "2.2.0",
"group": "list"
+ "summary": "Kill the connection of a client",
+ "complexity": "O(N) where N is the number of client connections",
+ "arguments": [
+ {
+ "name": "ip:port",
+ "type": "string"
+ }
+ ],
+ "since": "2.4.0",
+ "group": "server"
+ },
+ "summary": "Get the list of client connections",
+ "complexity": "O(N) where N is the number of client connections",
+ "since": "2.4.0",
+ "group": "server"
+ },
"summary": "Get the value of a configuration parameter",
"arguments": [
@@ -0,0 +1,15 @@
+The `CLIENT KILL` command closes a given client connection identified
+by ip:port.
+The ip:port should match a line returned by the `CLIENT LIST` command.
+Due to the single-treaded nature of Redis, it is not possible to
+kill a client connection while it is executing a command. From
+the client point of view, the connection can never be closed
+in the middle of the execution of a command. However, the client
+will notice the connection has been closed only when the
+next command is sent (and results in network error).
+@status-reply: `OK` if the connection exists and has been closed
@@ -0,0 +1,59 @@
+The `CLIENT LIST` command returns information and statistics about the client
+connections server in a mostly human readable format.
+@bulk-reply: a unique string, formatted as follows:
+* One client connection per line (separated by LF)
+* Each line is composed of a succession of property=value fields separated
+ by a space character.
+Here is the meaning of the fields:
+* addr: address/port of the client
+* fd: file descriptor corresponding to the socket
+* age: total duration of the connection in seconds
+* idle: idle time of the connection in seconds
+* flags: client flags (see below)
+* db: current database ID
+* sub: number of channel subscriptions
+* psub: number of pattern matching subscriptions
+* multi: number of commands in a MULTI/EXEC context
+* qbuf: query buffer length (0 means no query pending)
+* qbuf-free: free space of the query buffer (0 means the buffer is full)
+* obl: output buffer length
+* oll: output list length (replies are queued in this list when the buffer is full)
+* omem: output buffer memory usage
+* events: file descriptor events (see below)
+* cmd: last command played
+The client flags can be a combination of:
+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
+A: connection to be closed ASAP
+N: no specific flag set
+The file descriptor events can be:
+r: the client socket is readable (event loop)
+w: the client socket is writable (event loop)
+## Notes
+New fields are regularly added for debugging purpose. Some could be removed
+in the future. A version safe Redis client using this command should parse
+the output accordingly (i.e. handling gracefully missing fields, skipping
+unknown fields).

0 comments on commit eb48c2e

Please sign in to comment.