I was wondering how to disable presistence in redis. There is mention of the possibility of doing this here: http://redis.io/topics/persistence. I mean it in the exact same sense as described there. Any help would be very much appreciated!
By default Redis saves snapshots of the dataset on disk, in a binary file called dump. rdb . You can configure Redis to have it save the dataset every N seconds if there are at least M changes in the dataset, or you can manually call the SAVE or BGSAVE commands. This strategy is known as snapshotting.
If you started the Redis server using the redis-server command, you could stop the Redis server by pressing CTRL + C.
Redis PersistenceNo persistence: Redis can be entirely ephemeral with no persistence at all. Our data is only available while the server is running, and if for some reason the server was terminated or rebooted our data is lost.
To disable all data persistence in Redis do the following in the redis.conf
file:
Disable AOF by setting the appendonly
configuration directive to no
(it is the default value). like this:
appendonly no
Disable RDB snapshotting by commenting all of the save
configuration 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.
If you want to avoid playing with redis.conf
(dev/test environments), you can do it through the command line with
redis-server --save "" --appendonly no
(tested with redis server 3.2.6
and 5.0.5
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With