On Fri, Jan 23, 2015 at 04:23:45PM -0600, Jay Rolette wrote:
> On Fri, Jan 23, 2015 at 3:48 PM, Matt Palmer <
mpa...@hezmatt.org> wrote:
>
> > On Fri, Jan 23, 2015 at 03:10:45PM -0600, Jay Rolette wrote:
> > > Any chance I'm missing a config option somewhere that will let me specify
> > > auto-aof-rewrite after it gets larger than a specified size (instead of
> > > percentage)? There's a min size in bytes, but I didn't see a max.
> >
> > No, there's no auto-aof-rewrite-max-size directive. It wouldn't be
> > particularly hard to add, if you felt like getting your hands dirty. It
> > would *have* to default to "off", because otherwise any other default would
> > eventually result in a constant stream of AOF rewrites once an AOF got to a
> > certain size.
>
> I guess what I actually had in mind was more auto-aof-rewrite-max-growth
> that would trigger a rewrite after the AOF grew by X bytes. I should have
> described it a little better :)
That would be easy enough to do, too, and would provide more fine-grained
control over AOF rewrite semantics.
> > Another approach you could take, which wouldn't require any code
> > modifications, would be to trigger a BGAOFREWRITE immediately on startup.
> > That would trim any fat from the residual AOF, and would reset the size
> > measurement so that the percentage measurement would be based on the
> > minimal
> > AOF post-rewrite, rather than whatever was loaded at startup.
>
> I started down that path, but my startup is already a little slow because
> I'm having to do a redis-check-aof at startup to deal with AOF "corruption"
> cases I've mentioned previously.
I'm not familiar with the problems you've been having, but I'd hazard a
guess they're probably bugs in Redis that should be fixed.
> Running the file 3x on startup would be more time than I want to take right now.
The BGAOFREWRITE would run in the background, *after* Redis has startup and
is ready to serve requests. It wouldn't impact the time it takes to get
Redis to a point of usefulness.
I've also just thought of the possibility of adding a "rewrite on shutdown"
mode for AOF; that would provide you with a minimal AOF to load next time on
startup -- which would make startup quicker, eliminate corruption problems,
*and* give an accurate indication of file size for the percentage growth
algorithm to chew on. Best of all worlds! (at the cost of a slower shutdown)
- Matt