2 ms·
You can't do time-based caching like this. Block is either written, or it is not. When you flush your cache, you don't know how long it will take. Even if your
by vetinari 15y ago
You can't do time-based caching like this. Block is either written, or it is not. When you flush your cache, you don't know how long it will take. Even if your cache it is only fraction of second old.
That's why there used to be performance problems in apps with fsync().
- Dylan16807 15y agoWhat I'm saying is that you make it so as soon as the light stops blinking it's safe to remove. That means that you can have a cache as long as you flush it almost immediately. I've been bitten a couple times before by pulling drives on linux that weren't being written to, but still had a cache waiting to be written. I learned my lesson about not dismounting on an OS configuration where it isn't safe, but disabling caches is not the only way to be safe. It might take 10 seconds to flush the cache. That's okay. The key is that you never go more than a quarter second without writing to the disk until the cache is empty.