w3resource

Redis Server: CLIENT KILL [ip:port] [ID client-id]

Description

Redis CLIENT KILL command is used to close a given client connection.

With the new form, it is possible to kill clients by different attributes instead of killing just by address. Here is the following filters are available:

  • CLIENT KILL ID client-id. Allows to kill a client by its unique ID field.
  • CLIENT KILL TYPE type, where type is one of normal, slave, pubsub. This closes the connections of all the clients in the specified class.
  • CLIENT KILL SKIPME yes/no. By default this option is set to yes, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command.

Syntax:

Basic syntax of redis CLIENT KILL command is shown below:

CLIENT KILL [ip:port] [ID client-id] [TYPE normal|slave|pubsub] [ADDR ip:port] [SKIPME yes/no] 

Available since

2.4.0.

Return Value

Simple string reply: OK if the connection exists and has been closed

Return Value Type

String

Previous: BGSAVE
Next: CLIENT LIST



Follow us on Facebook and Twitter for latest update.