# CLIENT PAUSE

> Hold every client's commands, or only writes, for a number of milliseconds.

URL: https://docs.hotkv.com/commands/client-pause/

```
CLIENT PAUSE timeout [WRITE | ALL]
```

- Group: Connection
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`CLIENT PAUSE` stops the server from running client commands for `timeout`
milliseconds. Commands that arrive meanwhile are not refused: they wait, and
run in order once the pause ends. Use it to let replicas catch up before you
switch traffic to a new primary, or to freeze writes for a short maintenance
step.

## Options

| Option | Effect |
| --- | --- |
| `timeout` | Length of the pause in milliseconds. `0` is accepted. |
| `ALL` | Hold every command. This is the default. |
| `WRITE` | Hold only commands that may change data: write commands, plus `EXEC`, `EVAL`, `EVALSHA` and `FCALL`. Reads go on. |

[CLIENT UNPAUSE](https://docs.hotkv.com/commands/client-unpause/index.md) is never held, so you can always
end a pause early. Inside a transaction only `EXEC` is held; the commands
being queued are not.

If a pause is already active, the later end time of the two wins, and an
`ALL` pause stays `ALL` even if the new one asks for `WRITE`.

## Return value

| Case | Reply (RESP2 and RESP3) |
| --- | --- |
| Paused | Simple string `OK` |
| `timeout` is not an integer | Error `ERR timeout is not an integer or out of range` |
| `timeout` is negative | Error `ERR timeout is negative` |
| Mode is not `WRITE` or `ALL` | Error `ERR CLIENT PAUSE mode must be WRITE or ALL` |

## Examples

```
127.0.0.1:6379> CLIENT PAUSE 5000 WRITE
OK
127.0.0.1:6379> GET balance
"100"
127.0.0.1:6379> CLIENT UNPAUSE
OK
```

## Compatibility

Same options and replies as Redis 7 and Valkey 8.

## See also

[CLIENT UNPAUSE](https://docs.hotkv.com/commands/client-unpause/index.md), [WAIT](https://docs.hotkv.com/commands/wait/index.md),
[REPLICAOF](https://docs.hotkv.com/commands/replicaof/index.md)