To disable all data persistence in Redis do the following in the redis.conf file:
-
Disable AOF by setting the
appendonlyconfiguration directive tono(it is the default value). like this:appendonly no -
Disable RDB snapshotting by commenting all of the
saveconfiguration directives (there are 3 that are defined by default) and explicitly disabling saving:#save 900 1 #save 300 10 #save 60 10000 save ""
After change, make sure you restart Redis to apply them.
Alternatively, you can use the CONFIG SET command to apply these changes during runtime (just make sure you also do a CONFIG REWRITE to persist the changes).
Note: depending on your Redis’ version, there are other tweaks that prevent Redis from accessing the disk for replication-related tasks.