Sets configuration parameters in-flight.
CONFIG
SET
parameter value
[parameter value …]
The CONFIG SET
command is used in order to reconfigure
the server at run time without the need to restart Valkey. You can
change both trivial parameters or switch from one to another persistence
option using this command.
The list of configuration parameters supported by
CONFIG SET
can be obtained issuing a
CONFIG GET *
command, that is the symmetrical command used
to obtain information about the configuration of a running Valkey
instance.
All the configuration parameters set using CONFIG SET
are immediately loaded by Valkey 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 valkey.conf file.
Note that you should look at the valkey.conf file relevant to the version you’re working with as configuration options might change between versions. The link above is to the latest development version.
It is possible to switch persistence from RDB snapshotting to
append-only file (and the other way around) using the
CONFIG SET
command. For more information about how to do
that please check the persistence
page.
In general what you should know is that setting the
appendonly
parameter to yes
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 Valkey
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.
Simple string
reply: OK
when the configuration was set properly.
Otherwise an error is returned.
O(N) when N is the number of configuration parameters provided
@admin @dangerous @slow
ACL, ACL CAT, ACL DELUSER, ACL DRYRUN, ACL GENPASS, ACL GETUSER, ACL HELP, ACL LIST, ACL LOAD, ACL LOG, ACL SAVE, ACL SETUSER, ACL USERS, ACL WHOAMI, BGREWRITEAOF, BGSAVE, COMMAND, COMMAND COUNT, COMMAND DOCS, COMMAND GETKEYS, COMMAND GETKEYSANDFLAGS, COMMAND HELP, COMMAND INFO, COMMAND LIST, CONFIG, CONFIG GET, CONFIG HELP, CONFIG RESETSTAT, CONFIG REWRITE, DBSIZE, DEBUG, FAILOVER, FLUSHALL, FLUSHDB, INFO, LASTSAVE, LATENCY, LATENCY DOCTOR, LATENCY GRAPH, LATENCY HELP, LATENCY HISTOGRAM, LATENCY HISTORY, LATENCY LATEST, LATENCY RESET, LOLWUT, MEMORY, MEMORY DOCTOR, MEMORY HELP, MEMORY MALLOC-STATS, MEMORY PURGE, MEMORY STATS, MEMORY USAGE, MODULE, MODULE HELP, MODULE LIST, MODULE LOAD, MODULE LOADEX, MODULE UNLOAD, MONITOR, PSYNC, REPLCONF, REPLICAOF, RESTORE-ASKING, ROLE, SAVE, SHUTDOWN, SLOWLOG, SLOWLOG GET, SLOWLOG HELP, SLOWLOG LEN, SLOWLOG RESET, SWAPDB, SYNC, TIME.