--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/fuXVhavUdgoJ.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
Hi Everyone,As appendonly.aof file size can infinitely grow - what is the best practice to ensure that it doesnt grow larger than the system capcacity? I was under the impression that BGREWRITEAOF will compress the file, but I am not sure that is really happening. I am taking backups of this file and uploading it to s3. Should I delete this aof file on the machine, once the upload is completed? In the event of a disaster or failure should I just concatenate all the aof files from s3 to get the latest aof snapshot?
My point of concern is the aof file can grow infinitely larger, and I want to know what is the best practices out there. It seems like a common problem to solve, but I have not been successful in finding good solutions.
As for "best practices", the same best practices apply as you would
for your database. If you need daily backups, store the daily backups
in S3 or somewhere else. If you only need the most recent, only store
the most recent. The file will compress further with gzip or bzip2
(which is also the case for dump.rdb), and you should do your
cost/benefit analysis WRT time spent compressing (this is actually my
favorite article comparing the commonly used algorithms:
http://stephane.lesimple.fr/wiki/blog/lzop_vs_compress_vs_gzip_vs_bzip2_vs_lzma_vs_lzma2-xz_benchmark_reloaded
).
Regards,
- Josiah
On Tue, Feb 28, 2012 at 6:57 PM, Vinodh Krishnamoorthy
You should check the output of the INFO command, it will tell you if
AOF rewriting or a background dump is going on.
Cannot afford to lose, at all? As in, if you lose data from the most
recent 1/2 second, that would end your business? Or would it be okay
if you lost data from the most recent 1/2 second?
If you can't afford to lose *any* data, then you should buy a stack of
SSDs, set them up for RAID6 operation, set your file syncing options
to: "appendfsync always", and prepare yourself for replacing the SSDs
every 3-6 months. You'll want 2-3 slaves with that same setup.
Alternatively, set your syncing options to "appendfsync everysec", run
a few slaves (the SSDs are optional), then when you write to the
master, verify that the data you wrote is on the slaves, then wait an
additional second to ensure that the data got to disk.
If you can afford to lose up to 1 second's worth of data if something
horrible happens, set your aof file syncing options to: "appendfsync
everysec", run at least 1 slave.
In all cases, run your BGREWRITEAOF only when the AOF gets too large
to be reasonable (every 15 minutes seems excessive to me, how much are
you writing?)
If you want safe point-in-time backups to restore from, use regular
dumps and BGSAVE. Why? If you had copied an AOF between fsync
operations (which I just recommended you set to once per second), you
may end up with a partial AOF, which requires that you fix it. That
*may* be better for getting the most data, but getting an error during
a restore operation is painful. With slaves, hopefully you won't run
into needing to start from a partial AOF, you should be able to copy a
fully synced slave AOF to the master.
> redis.log to see that the execution happened successfully, or see that the
> child process that it forked finished successfully? What are some common
> techniques?
When most people realize how difficult it is to literally guarantee
that their data is safe (appendfsync everysec, or waiting at least 1
second), most people realize that they can deal with a little bit of
loss. Also, I usually recommend to push back on management until they
say "it's okay if we lose *some* data", because everything else leads
to madness (and needing to spend a lot of $ to ensure that your data
is in 5x places at the same time, is backed up to S3 and at least 2
other non-Amazon data centers, etc).
Regards,
- Josiah