config rewrite

CONFIG

CONFIG REWRITE

The CONFIG REWRITE command rewrites the redis.conf file the server was started with, applying the minimal changes needed to make it reflect the configuration currently used by the server, which may be different compared to the original one because of the use of the CONFIG SET command.

The rewrite is performed in a very conservative way:

  • Comments and the overall structure of the original redis.conf are preserved as much as possible.
  • If an option already exists in the old redis.conf file, it will be rewritten at the same position (line number).
  • If an option was not already present, but it is set to its default value, it is not added by the rewrite process.
  • If an option was not already present, but it