"Logrotate" AOF

207 views
Skip to first unread message

David Chia

unread,
Nov 9, 2014, 2:42:20 PM11/9/14
to redi...@googlegroups.com
Hi all.

I have a question about how everyone deals with the Redis persistency under high write throughput situation, where 6+ GB of data are written to Redis every hour. The data are append-only time series and they expire as soon as they're aggregated.

With the RDB setting, it creates hiccups every (defined in the conf) X minutes for taking a snapshot and it uses about (in my case) 1/3 of the memory for COW. AOF is better, but AOF rewrite is no different from dumping the database. 1/3 of memory reserved for any future dumps is definitely not good, not to mention about that performance hit.

It seems to me that rotating the AOF, instead of rewriting, is more reasonable for my case. I've found some people are already doing that https://github.com/liujianping/redis-2.6.16-rotate-aof/blob/master/redis.conf#L440-L464, but it's a bit outdated... and I'm not sure how reliable that is...

Before I try out that aof-rotate, have anyone else dealt something similar before? Any insight? Is aof-rotate something Redis gonna support in the future?


Thanks for any help in advance
David

Matt Palmer

unread,
Nov 9, 2014, 5:50:33 PM11/9/14
to redi...@googlegroups.com
On Sun, Nov 09, 2014 at 11:42:20AM -0800, David Chia wrote:
> With the RDB setting, it creates hiccups every (defined in the conf) X
> minutes for taking a snapshot and it uses about (in my case) 1/3 of the
> memory for COW. AOF is better, but AOF rewrite is no different from dumping
> the database. 1/3 of memory reserved for any future dumps is definitely not
> good, not to mention about that performance hit.

Define "hiccup"... if the background operations of Redis are causing you
performance problems, you probably need to reassess the hardware platform
you're running Redis on. On an appropriate system configuration, the
background operations should have no noticeable impact.

> It seems to me that rotating the AOF, instead of rewriting, is more
> reasonable for my case. I've found some people are already doing
> that https://github.com/liujianping/redis-2.6.16-rotate-aof/blob/master/redis.conf#L440-L464,
> but it's a bit outdated... and I'm not sure how reliable that is...

Based purely on reading that segment of the example config file, that method
is guaranteed to lose data -- there's no way for Redis to reconstruct the
exact dataset that was in memory after a restart if you've overwritten some
older portions of the AOF.

> Before I try out that aof-rotate, have anyone else dealt something similar
> before? Any insight? Is aof-rotate something Redis gonna support in the
> future?

I doubt that aof-rotate will be supported by Redis mainstream. In your
situation, given that Redis appears to be used as a cache, and you're OK
with losing some data (I assume, given that you considered using RDB for
persistence), I'd recommend considering running Redis purely as a cache.
That will eliminate all "hiccups" due to background persistence operations;
you'll just have to reload all missing data on restart.

- Matt

--
New Yankee Workshop isn't a "how to" for home hobbyists, it's "Baywatch" for
powertool fetishists.
-- Geoff Kinnel, ASR

Reply all
Reply to author
Forward
0 new messages