CLIENT PAUSE
CLIENT PAUSE timeout [WRITE | ALL]
- Group
- Connection
- Complexity
- O(1)
- Arity
- -3 (at least 3 words, counting the command name)
- 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
Section titled “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 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
Section titled “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
Section titled “Examples”127.0.0.1:6379> CLIENT PAUSE 5000 WRITEOK127.0.0.1:6379> GET balance"100"127.0.0.1:6379> CLIENT UNPAUSEOKCompatibility
Section titled “Compatibility”Same options and replies as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.