0

on Linux, using various benchmark tools (bonnie++, iozone, etc) on ext4 (but i guess it's the same on other FS), rewrite is always slower than write to new files.

For example, using bonnie++, with 24GB files (host with 12GB), block write is 167MB/s when rewrite is 64MB/s.

So it seems to me that rewrite is always slower than write. What could explain this ? Internal FS operations (free old blocks, allocate new ones ?) ? RAID design ? Thank you.

Benoît
  • 1,341
  • 3
  • 11
  • 23
  • Could it the same reason my floor has dirty clothes all over it? Putting clothes in the laundry hamper takes longer than throwing them just anywhere... so I throw them just anywhere, instead of taking the time to locate, move to and place dirty clothes in the laundry hamper. – HopelessN00b Jan 21 '14 at 16:46
  • Rewrite requires dealing with the old contents, write does not. What are your journalling settings? – David Schwartz Jan 21 '14 at 16:57
  • That's really slow... what are you running this on? – ewwhite Jan 21 '14 at 17:19
  • what flags are used to open these files? – Matthew Ife Jan 21 '14 at 20:33

1 Answers1

0

If the benchmark I/O is not aligned with the underlying OS and driver block sizes, then a rewrite can involve reading one or more blocks merging the new data and then rewriting.

If you are certain that this is not happening (as it does not on new files) then it is possible that some journalling is affecting performance. There should not be any block allocation taking place as the file has already been allocated.

Of course, an SSD volume will experience different behaviour as block movement could take place to assist with wear management.

Pekka
  • 530
  • 5
  • 15