{
  "schema_version": 2,
  "id": "commands/client-kill",
  "title": "CLIENT KILL",
  "url": "https://redis.io/docs/latest/commands/client-kill/",
  "summary": "Terminates open connections.",
  "since": "2.4.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:21+01:00",
  "page_type": "content",
  "content_hash": "9ead7388ff215fcdcc5449c94e9448fc17488046805366bd69f85bc31512d94d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `CLIENT KILL` command closes a given client connection. This command support two formats, the old format:\n\n    CLIENT KILL addr:port\n\nThe `ip:port` should match a line returned by the [`CLIENT LIST`](https://redis.io/docs/latest/commands/client-list) command (`addr` field).\n\nThe new format:\n\n    CLIENT KILL <filter> <value> ... ... <filter> <value>\n\nWith the new form it is possible to kill clients by different attributes\ninstead of killing just by address. See below for the list of supported filters.\n\nIt is possible to provide multiple filters at the same time. Multiple filters are combined using logical AND.\n\n    CLIENT KILL addr 127.0.0.1:12345 type pubsub\n\nis valid and will kill only a pubsub client with the specified address.\n\nWhen the new form is used the command no longer returns `OK` or an error, but instead the number of killed clients, which may be zero."
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "Provide the legacy `ip:port` argument to close a client by address, or one or more of the following filters, which can be combined to select the clients to close.\n\n<details open><summary><code>ip:port</code></summary>\n\nClose the client at the given address. This is the legacy single-argument form.\n\n</details>\n\n<details open><summary><code>ID client-id</code></summary>\n\nClose only the client with the given unique ID.\n\n</details>\n\n<details open><summary><code>TYPE NORMAL | MASTER | SLAVE | REPLICA | PUBSUB</code></summary>\n\nClose only clients of the given type.\n\n</details>\n\n<details open><summary><code>USER username</code></summary>\n\nClose only clients authenticated as the given ACL user.\n\n</details>\n\n<details open><summary><code>ADDR ip:port</code></summary>\n\nClose only clients connected from the given address.\n\n</details>\n\n<details open><summary><code>LADDR ip:port</code></summary>\n\nClose only clients connected to the given local (server) address.\n\n</details>\n\n<details open><summary><code>SKIPME YES | NO</code></summary>\n\nWhether to skip the calling client (`YES`, the default) or allow it to be closed too (`NO`).\n\n</details>\n\n<details open><summary><code>MAXAGE maxage</code></summary>\n\nClose only clients older than the given age, in seconds.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "client-kill-and-redis-sentinel",
      "title": "CLIENT KILL and Redis Sentinel",
      "role": "content",
      "text": "Recent versions of Redis Sentinel (Redis 2.8.12 or greater) use CLIENT KILL\nin order to kill clients when an instance is reconfigured, in order to\nforce clients to perform the handshake with one Sentinel again and update\nits configuration."
    },
    {
      "id": "notes",
      "title": "Notes",
      "role": "content",
      "text": "Due to the single-threaded nature of Redis, it is not possible to\nkill a client connection while it is executing a command. From\nthe client point of view, the connection can never be closed\nin the middle of the execution of a command. However, the client\nwill notice the connection has been closed only when the\nnext command is sent (and results in network error)."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` when called in 3 argument format and the connection has been closed.\n* [Integer reply](../../develop/reference/protocol-spec#integers): when called in filter/value format, the number of clients killed.\n\n**RESP3:**\n\nOne of the following:\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK` when called in 3 argument format and the connection has been closed.\n* [Integer reply](../../develop/reference/protocol-spec#integers): when called in filter/value format, the number of clients killed."
    }
  ],
  "examples": []
}
