{
  "schema_version": 2,
  "id": "develop/reference/errors/common/busy",
  "title": "BUSY error",
  "url": "https://redis.io/docs/latest/develop/reference/errors/common/busy/",
  "summary": "A Lua script or function has run for too long, and Redis is blocked until it ends.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-02T15:10:28+01:00",
  "page_type": "content",
  "content_hash": "e5f455f5fec5bbbfab249d767effdb51653a46e75808118ee1b203f7facfb398",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Redis returns this error when a Lua script or function has run for longer than the `busy-reply-threshold` setting, which is 5 seconds by default. While a script runs, Redis doesn't run any other command. So instead of making other clients wait, Redis answers almost every command with this error, even `PING`.\n\n[code example]\n\nFor a function, the message names `FUNCTION KILL` instead of `SCRIPT KILL`. A module command that runs for a long time causes a similar error: `BUSY Redis is busy running a module command.`"
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "While another client runs a script that never ends:\n\n[code example]"
    },
    {
      "id": "how-to-fix-it",
      "title": "How to fix it",
      "role": "content",
      "text": "1. Stop the script with [`SCRIPT KILL`](https://redis.io/docs/latest/commands/script-kill), or stop a function with [`FUNCTION KILL`](https://redis.io/docs/latest/commands/function-kill). The client that ran the script then gets an error that starts with `ERR Script killed by user with SCRIPT KILL`.\n1. If the script has already changed data, Redis can't stop it, because that would leave the change half done. `SCRIPT KILL` then fails:\n\n    [code example]\n\n    You can either wait for the script to finish, or stop the server with [`SHUTDOWN NOSAVE`](https://redis.io/docs/latest/commands/shutdown). `SHUTDOWN NOSAVE` loses all changes that weren't saved to disk.\n1. Change the script so that it can't run this long. Common causes are a loop that never ends, and a script that processes too many keys or elements in one call. Split large jobs into several smaller calls.\n\nSee [Maximum execution time](https://redis.io/docs/latest/develop/programmability#maximum-execution-time)."
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "plaintext",
      "code": "BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.",
      "section_id": "overview"
    },
    {
      "id": "example-ex0",
      "language": "plaintext",
      "code": "> GET mykey\n(error) BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.\n> SCRIPT KILL\nOK",
      "section_id": "example"
    },
    {
      "id": "how-to-fix-it-ex0",
      "language": "plaintext",
      "code": "UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.",
      "section_id": "how-to-fix-it"
    }
  ]
}
