On 9/28/18 2:28 PM, Dave Ulrick wrote:
Thanks, that makes sense. Any idea of why unlink()ing the file seems
to be faster than truncating it?
As best I understand it, one process is async and parallel:
unlink, clear block list, sync to disk
open, write, close, sync to disk
Where the other process is synchronous and linear:
open, truncate, clear block list, write, close, sync to disk
Filesystem benchmark tools (bonnie++ for example) test file write and
file re-write separately, and it's normal for re-write to be slower.