To disable specific commands that may degrade service performance and cause data loss, you can set the #no_loose_disabled-commands parameter in the console.

Background

In certain scenarios, unlimited usage of commands may cause some issues. Some Redis commands can delete a large volume of data or all data in a database, such as flushall and flushdb. Improper uses of some commands such as keys and hgetall may cause blocking in the single-threading Redis model and degrade service performance.

To ensure stable and efficient management, you can disable these commands to minimize risks in your workloads.

Modify the parameter in the ApsaraDB for Redis console

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the Instance ID of the instance.
  4. In the left-side navigation pane, click System Parameters.
  5. On the System Parameters page, find the #no_loose_disabled-commands parameter and click Modify in the Actions column.
    Disable specific Redis commands
  6. In the dialog box that appears, specify the commands to be disabled.
    Specify the Redis commands to be disabled.
    Note The parameter value can contain only lowercase letters. Separate multiple commands with commas (,). For example, keys,flushall.
  7. Click OK.

Result

If you use redis-cli to connect to an instance and run the disabled FLUSHALL command, ApsaraDB for Redis returns the following error: (error) ERR command 'FLUSHALL' not support for normal user.Results