microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.78k stars 5.37k forks source link

How to know when your AOF is written to when using appendfsync=no? #518

Closed chester89 closed 7 years ago

chester89 commented 7 years ago

Hello. I'm using Redis v2.8.2103, considering updating to 2402. I'm using Windows Server 2008 R2. I have a production machine with not-so-fast disk, plus there's other apps running there. Right now, changing hosting is not an option. In Redis log files I see a line Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis. message almost each time AOF is written to disk. At first, I used appendfsync=everysec with no-appendfsync-on-rewrite=yes in my config file. Then I switched no-appendfsync-on-rewrite to no (which is recommended in case you have slow disk) - it didn't solve the problem. Now I'd like to try switching to appendfsync=no and I want to know - how often would my AOF be written to disk? My question - is there any way to estimate that window (between data changed in memory and AOF actually hit the disk plate)? Or is it completely up to the OS? I would like an estimate because machine holds important data and an app can't tolerate data loss

chester89 commented 7 years ago

After I moved to 2402 release almost a week ago with the same configuration, the problem appeared only once. Will continue to monitor the problem

chester89 commented 7 years ago

Ok seems that updating to 2402 helped - a month without such issues is good thing