Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Redis' background AOF rewrites are killing performance of our service.

The general consensus is to move AOF persistence to a slave in a separate VM and disable it on master.

There is a problem with that approach: what if master accidentally restarts? Master does not have any data, so it will come back empty. Slave will then synchronize and drop all stored data.

Is there a robust workaround for this? Any advice?

share|improve this question
add comment

1 Answer

You have a few options. First, don't allow the master instance to simply start on it's own.

Second, depending in your particular scenario and requirements you could have the slave write the AOF to a shared file system or run the slave on te same node. Then, you could have the config file enable AOF and read from where te file is stored.

Then your start process is something like: 1) start redis with AOF 2) when done reading it, your monitor script disables AOF using the config set command.

This assumes AOF can be changed via the coding set command - I'm not by a system I can test with.

If it can't, then you would instead need to alter the master/slave relationship on master start so it syncs the data from the slave. This would also be a custom setup but not too tricky.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.