Running Redis memory-only

1,516 views
Skip to first unread message

Branden Visser

unread,
Nov 7, 2013, 4:30:56 PM11/7/13
to redi...@googlegroups.com
Hello,

I find it unexpected that Redis will read from disk the dump.rdb file that is dumped for slave sync, even when the Redis server has not been configured to save snapshots. Adds quite a bit risk that Redis starts up primed with stale data, especially if the deployer wasn't aware they had to put in an external job to delete the file on a regular basis.

Are there any plans to, for example, configure Redis to never read state from disk when it starts up, so that it may operate as a memory-only cache?

Thanks,
Branden

Salvatore Sanfilippo

unread,
Nov 7, 2013, 6:03:52 PM11/7/13
to Redis DB
It is tricky to remove loading at startup as there are also people
that disable persistence but then persist issuing manual BGSAVE and
want the server to re-read the data on startup.

Probably the best we can do is to add a new configuration option to
don't load data at startup, so for the behavior you expect you just
disable persistence at all, and enable the option to start without
loading.
Sounds reasonable?

Cheers,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Salvatore 'antirez' Sanfilippo
open source developer - GoPivotal
http://invece.org

We suspect that trading off implementation flexibility for
understandability makes sense for most system designs.
— Diego Ongaro and John Ousterhout (from Raft paper)

Greg Andrews

unread,
Nov 7, 2013, 8:25:12 PM11/7/13
to redi...@googlegroups.com
One option:  Modify the startup script to delete the RDB file before starting the Redis server process.  Redis can't load data from a file that doesn't exist.

  -Greg


--

Salvatore Sanfilippo

unread,
Nov 8, 2013, 3:13:43 AM11/8/13
to Redis DB
That's also not perfectly ideal, you many use Redis as an in-memory
cache bug BGSAVE from time to time in order to do analysis, and it is
a shame if after a restart you lose your snapshots.

Branden Visser

unread,
Nov 8, 2013, 9:41:46 AM11/8/13
to redi...@googlegroups.com
I like the idea of a configuration not to load data on start-up, sounds reasonable to me.

Updating the startup script to delete it might also be a problem because then the dump file path becomes detatched from configuration, and if it's updated in one location and not another, you aren't aware of your mistake until you have really weird side-effects in production.

Thanks for the quick response!

Cheers,
Branden

Javier Guerra Giraldez

unread,
Nov 8, 2013, 11:09:26 AM11/8/13
to redi...@googlegroups.com
On Fri, Nov 8, 2013 at 3:13 AM, Salvatore Sanfilippo <ant...@gmail.com> wrote:
> That's also not perfectly ideal, you many use Redis as an in-memory
> cache bug BGSAVE from time to time in order to do analysis, and it is
> a shame if after a restart you lose your snapshots.
>
>
> On Fri, Nov 8, 2013 at 2:25 AM, Greg Andrews <hva...@gmail.com> wrote:
>> One option: Modify the startup script to delete the RDB file before
>> starting the Redis server process. Redis can't load data from a file that
>> doesn't exist.


what about renaming it out instead of deleting it?

--
Javier

The Baldguy

unread,
Nov 9, 2013, 2:17:49 AM11/9/13
to redi...@googlegroups.com
I'm I favor of a config option to not read rdb on startup, especially if i can tell it to go ahead and read it in using a command. Then again I make heavy use if the live config system. In a dynamic config such as I use, this would be an awesome benefit.

Hikeonpast

unread,
Nov 9, 2013, 11:58:17 PM11/9/13
to redi...@googlegroups.com
A config option would be useful.  I see a peripheral benefit in that slaves could be prevented from reading a stale snapshot on startup, prior to starting the re-sync with master.  For large instances, the slave startup+re-sync time could be reduced appreciably by skipping the load of the stale RDB that is promptly discarded by the Master's snapshot.

Cheers,

Dean

Colin Vipurs

unread,
Nov 11, 2013, 1:37:02 PM11/11/13
to redi...@googlegroups.com
Another +1 for a config option


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.



--
Maybe she awoke to see the roommate's boyfriend swinging from the chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.
Reply all
Reply to author
Forward
0 new messages