:original_name: dcs-pd-200813004.html

.. _dcs-pd-200813004:

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.

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.
