I'm re-building a server that needs to do awfully lot of I/O to complete the task. Is there a way to tell Linux to temporarily ignore all sync()
, syncfs()
and fdatasync()
from any processes? I think the rebuilding would complete faster if I never wait for storage to flush caches until once when I finally unmount the storage.
I'm hoping something like
mount -o remount,nosync /path/to/mount/point
but obviously nosync
does not exist (only sync
and async
).
I know about some hacks with LD_LIBRARY_PATH
to override those syscalls but is there anything system wide that I can activate when processes have already been started?
I understand that using such a feature would force me to restart from the start if power is interrupted or the system crashes. I would happily take my changes during the rebuild process.
Breaking the semantics of sync() and friends is dangerous for data integrity, if it were feasible.
Configure your application to sync() less. For a database, disable any journal and read the manual regarding what that means for recovery.
Add lots of IOPS via the fastest SSD you have. Consider adding it as a caching tier if you don't have the capacity to put it all on fast solid state.
You have not described the file system type, directory structure, or I/O patterns. These can change the storage demands considerably. For example, millions of small files is usually results in lots of metadata I/O.
Edit: if this is copying a large number of files, consider doing an image based restore. Send an entire snapshot with LVM and dd, zfs send, btrfs send, or replicate the underlying disk. Avoids all the file system metadata I/O. Which will take a long time on handful of spindles.
That's not what sync and async mount options mean. They mean synchronous and asynchronous writes. async is the default, and is what you should use to not wait for every I/O.