1

We are developing a piece of software that does a lot of file overwrites. For the sake of simplicity/performance, we currently don't compare the old file content with the new content that will be overwritten on the disk. So we overwrite files even if when their content is identical.

We run these operations several times a day on a SSD. Does it have a negative effect on SSD wearing ?

Or are modern OS's/NAND controllers smart enough to figure out that the data we're writing is identical to the old one ? (we are targeting Windows based systems)

1
  • 1
    Doing this on an SSD is counterproductive due to the wear levelling algorithm. Overwriting the file is not guaranteed to actually write data over the blocks that the file currently occupies. What you want to do it trim the file and let the SSD controller erase the block for you.
    – Mokubai
    Mar 23, 2018 at 21:17

1 Answer 1

4

Short answer. No the controllers do not examine the current file contents before overwriting. That would add significant overhead to a write operation that 99% of time is writing new data.

The good news is that SSDs can actually take a LOT of writes before they die. For some interesting experimental data see the following articles from Tech Report:

Introducing the SSD Endurance Experiment

The SSD Endurance Experiment: They're all dead

Additionally wear leveling mechanisms on SSDs attempt to ensure erasures and re-writes are distributed evenly across the medium (see Wikipedia for more info). So the write operation most likely won't even be going to the same physical location in memory.

However if you can possibly determine that the contents are the same I would suggest avoiding the write. In the end it comes down to performance vs size of data being written.

2
  • Thank's a lot for answer ! By any chance, would you know a piece of documentation further detailing this ?
    – Simon V.
    Mar 26, 2018 at 13:06
  • 1
    Added some info about wear leveling to my answer. You can also read this article about write amplification en.wikipedia.org/wiki/Write_amplification Mar 26, 2018 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .