CONFIG SET

CONFIG SET parameter value [parameter value ...]
Available since:
Redis Open Source 2.0.0
Time complexity:
O(N) when N is the number of configuration parameters provided
ACL categories:
@admin, @slow, @dangerous,
Compatibility:
Redis Software and Redis Cloud compatibility

CONFIG SET reconfigures Redis at runtime without restarting the server. You can use it to change simple configuration parameters or switch between persistence options.

Run CONFIG GET * to list the configuration parameters that CONFIG SET supports.

All the configuration parameters set using CONFIG SET are immediately loaded by Redis and will take effect starting with the next command executed.

All the supported parameters have the same meaning of the equivalent configuration parameter used in the redis.conf file. The provided link has links to the redis.conf files for Redis version 6.2 and greater. See the Redis souce code repo for earlier versions.

It is possible to switch persistence from RDB snapshotting to append-only file (and the other way around) using the CONFIG SET command. See the persistence page for more information.

CONFIG SET appendonly yes

Setting the appendonly parameter as shown above will start a background process to save the initial append-only file (obtained from the in memory data set), and will append all the subsequent commands on the append-only file, thus obtaining exactly the same effect of a Redis server that started with AOF turned on since the start.

You can have both the AOF enabled with RDB snapshotting if you want, the two options are not mutually exclusive.

Required arguments

parameter value [parameter value ...]

One or more configuration parameter-value pairs to set.

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active
Only supports a subset of configuration settings.

Return information

Simple string reply: OK when the configuration was set properly. Otherwise an error is returned.

History

  • Starting with Redis version 7.0.0: Added the ability to set multiple parameters in one call.
RATE THIS PAGE
Back to top ↑