On Mon, 14 Sep 2009, Edward Ned Harvey wrote:

>> If you had a 64G flash device which was rewriteable 2 million times
>> (which may be on the low end even, I can't find the rewrite spec for
>> the Intel SSD) you would have to write 64G*2,000,000 writes = 128
>> petabytes. 128P/73T per year means this could last you for 1,753 years.
>> Is my math right? It's so easy to be off by an order of magnitude in
>
> Sorry, but you're way off.  Given the specs you mentioned, you would need to
> write 2Megabytes to blow the drive, if only you write a single byte
> 2,000,000 times in the same location.

that is if the device does not do wear leveling.

> The key is:  While you're doing writes, how well does your usage pattern
> distribute the writes across different blocks each time?  If you are
> continually doing database operations, you might simply be writing and
> rewriting in tight clusters of disk blocks all the time...

no, wear leveling makes it so that you don't know where on the device the 
block is actually being written. you may always write to the same block 
(the way a FAT filesysem would for example), but the device will remap 
that block so you end up having to write 2MB to every eraseblock on the 
device.

eraseblocks are relativly large (128K or so), so a 64G flash device with 
wear leveling would require that you write 2m 1-byte writes * 64G * 8K 
eraseblocks/G or 1TB of data one byte at a time to the same block.

given that writes are by 512B blocks this is at least 512TB of written 
data.

you also need to do a fsync between each write (or the OS/flash will 
combine the writes), you also can't write to different blocks or the flash 
may decide to combine the two writes to one flash block.

it is possible to run into problems with this sort of thing, but you have 
to do a LOT of writing.

if you used this for a log server, and did 100k writes/sec (doing a fsync 
between each log write) you would be able to do 10,000,000 seconds worth 
of logs before the drive would fail. this is only 115 days, so if you are 
doing this watch out.

but if you have less stringent loads, you are unlikly to have problems.

> Be cautious.
>
> I can think of one way to possibly protect yourself from this sort of
> problem.  I think (but I'm not totally sure - so please confirm with
> developers or experts) that ZFS uses copy-on-write algorithm for disk block
> allocation, which means the filesystem will choose to overwrite *different*
> blocks instead of overwriting the same block that was previously written.  I
> think this would help distribute your writes throughout the physical medium,
> and alleviate at least some of the risk.

it doesn't matter what the filesystem does, the flash translation layer 
that does the wear leveling changes things anyway.

David Lang
_______________________________________________
Discuss mailing list
Discuss@lopsa.org
http://lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to