{
  "schema_version": 2,
  "id": "commands/latency-doctor",
  "title": "LATENCY DOCTOR",
  "url": "https://redis.io/docs/latest/commands/latency-doctor/",
  "summary": "Returns a human-readable latency analysis report.",
  "since": "2.8.13",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:09+01:00",
  "page_type": "content",
  "content_hash": "ad3e9b6b8959421993107a9acacde1c3eaf75ffe4f743e3d8c2cbb8acb7661f2",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `LATENCY DOCTOR` command reports about different latency-related issues and advises about possible remedies.\n\nThis command is the most powerful analysis tool in the latency monitoring\nframework, and is able to provide additional statistical data like the average\nperiod between latency spikes, the median deviation, and a human-readable\nanalysis of the event. For certain events, like `fork`, additional information\nis provided, like the rate at which the system forks processes.\n\nThis is the output you should post in the Redis mailing list if you are\nlooking for help about Latency related issues."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]\n\n**Note:** the doctor has erratic psychological behaviors, so we recommend interacting with it carefully.\n\nFor more information refer to the [Latency Monitoring Framework page](https://redis.io/docs/latest/operate/oss_and_stack/management/optimization/latency-monitor)."
    },
    {
      "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=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): a human readable latency analysis report.\n\n**RESP3:**\n\n[Verbatim string reply](../../develop/reference/protocol-spec#verbatim-strings): a human readable latency analysis report."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "127.0.0.1:6379> latency doctor\n\nDave, I have observed latency spikes in this Redis instance.\nYou don't mind talking about it, do you Dave?\n\n1. command: 5 latency spikes (average 300ms, mean deviation 120ms,\n    period 73.40 sec). Worst all time event 500ms.\n\nI have a few advices for you:\n\n- Your current Slow Log configuration only logs events that are\n    slower than your configured latency monitor threshold. Please\n    use 'CONFIG SET slowlog-log-slower-than 1000'.\n- Check your Slow Log to understand what are the commands you are\n    running which are too slow to execute. Please check\n    http://redis.io/commands/slowlog for more information.\n- Deleting, expiring or evicting (because of maxmemory policy)\n    large objects is a blocking operation. If you have very large\n    objects that are often deleted, expired, or evicted, try to\n    fragment those objects into multiple smaller objects.",
      "section_id": "examples"
    }
  ]
}
