w3resource

Redis Server: CONFIG SET

Redis CONFIG SET Command

Redis CONFIG SET command is used in order to reconfigure the server at run time without the need to restart Redis. Both the trivial parameters or switch from one to another persistence option can be changed using this command.

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

Here are some common uses and scenarios for the "CONFIG SET" command:

  • Dynamic Configuration Changes: Modifies Redis configuration parameters at runtime without restarting the server.
  • Immediate Effect: Applies changes immediately, allowing for on-the-fly adjustments to Redis behavior.
  • Optimization: Enables fine-tuning of Redis settings to optimize performance based on current workload or use case.
  • Testing: Useful for testing configuration changes before applying them permanently.
  • Configuration Management: Assists in managing Redis configurations for specific operational needs or scenarios.

Syntax:

CONFIG SET parameter value 

Available since

2.0.0.

Return Value

String reply: OK when the configuration was set properly. Otherwise, an error is returned.

Return Value Type

String

Example: Redis CONFIG SET

redis 127.0.0.1:6379> CONFIG Get "requirePass" 
""
redis 127.0.0.1:6379> CONFIG Set "requirePass" "pass1" 
OK

Previous: CONFIG REWRITE
Next: CONFIG RESETSTAT



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/redis/redis-server-config-set-parameter-value.php