Updated on 2024-11-26 GMT+08:00

Other Command Usage Restrictions

This section describes restrictions on some Redis commands.

KEYS Command

In case of a large amount of cached data, running the KEYS command may block the execution of other commands for a long time or occupy exceptionally large memory. Therefore, when running the KEYS command, describe the exact pattern and do not use fuzzy keys *. Do not use the KEYS command in the production environment. Otherwise, the service running will be affected.

Commands in the Server Group

  • While running commands that take a long time to run, such as FLUSHALL, DCS instances may not respond to other commands and may change to the faulty state. After the command finishes executing, the instance will return to normal.
  • When the FLUSHDB or FLUSHALL command is run, execution of other service commands may be blocked for a long time in case of a large amount of cached data.

EVAL and EVALSHA Commands

  • When the EVAL or EVALSHA command is run, at least one key must be contained in the command parameter. Otherwise, the error message "ERR eval/evalsha numkeys must be bigger than zero in redis cluster mode" is displayed.
  • When the EVAL or EVALSHA command is run, a cluster DCS Redis instance uses the first key to compute slots. Ensure that the keys to be operated in your code are in the same slot. For details, visit https://redis.io/commands.
  • For the EVAL command:
    • You are advised to learn the Lua script features of Redis before running the EVAL command. For details, see https://redis.io/commands/eval.
    • The execution timeout time of a Lua script is 5 seconds. Time-consuming statements such as long-time sleep and large loop statements should be avoided.
    • When calling a Lua script, do not use random functions to specify keys. Otherwise, the execution results are inconsistent on the master and standby nodes.

Debugging Lua Scripts

When you debug Lua scripts for Proxy Cluster and read/write splitting instances, only the asynchronous non-blocking mode --ldb is supported. The synchronous blocking mode --ldb-sync-mode is not supported. By default, the maximum concurrency on each proxy is 2. This restriction does not apply to other instance types.

Other Restrictions

  • The time limit for executing a Redis command is 15 seconds. To prevent other services from failing, a master/replica switchover will be triggered after the command execution times out.