Mysql on flash-memory
am 20.09.2006 08:41:51 von dan
Hi all,
I have a question about flash-memory lifespan.
My database consists of 1 table, the table has 50 fields of 10 bytes
each, thus each record will have 500bytes. There are 1000 records in
the table, so roughly the table will have a size of 0.5MByte. The
system will update the record sequentially, one record is updated per
second. That is 3600 update per hour or 86400 per day.
If I store this database on a 64MB flash-memory card then how long does
the card last before wearing out.
Thanks in advance,
Dan
Re: Mysql on flash-memory
am 20.09.2006 18:25:32 von Bill Karwin
dan wrote:
> If I store this database on a 64MB flash-memory card then how long does
> the card last before wearing out.
I looked into this some time ago and tried to find some articles
describing the MTBF (mean time between failure) of flash memory. Of
course there are many claims that it lasts virtually forever, but that's
what they said about CDROM's for years.
From what I've read, MTBF for flash memory is between 1 million to 3
million hours. Another source says that rewriting is more wearing to
flash memory, thus it can withstand perhaps 500,000 to 1 million writes
before the potential for failure increases.
Also see http://www.embeddedintel.com/display.php?article=53, where the
heading "boosting flash lifetime" appears.
Some technology vendors use "wear-leveling" to improve MTBF of flash
devices. See the QNX Flash File System Technology Development Kit
brochure
(http://partners.qnx.com/download/download/9465/flash_fsys_t dk.pdf), and
the SanDisk wear-leveling white paper
(http://www.sandisk.com/Assets/File/OEM/WhitePapersAndBrochu res/RS-MMC/WPaperWearLevelv1.0.pdf)
Regards,
Bill K.
Re: Mysql on flash-memory
am 21.09.2006 07:13:48 von dan
Thanks for the interesting articles Bill,
So now I need to calculate how many times a single physical bit on the
flash get erased per day, assuming there is a wear-leveling mechanism
in place to spread out the block erase evenly. Then I can work out the
lifespan of the 64Mb flash card.
My question now is much data MySql write to flash every second ? Given
that the system updates one record of 500bytes every second. Will it
cause MySql to write to flash 500 bytes per second, or will it cause
MySql to write the whole file of 500Kbytes to flash every second ?
Regards,
Dan.
Bill Karwin wrote:
> dan wrote:
> > If I store this database on a 64MB flash-memory card then how long does
> > the card last before wearing out.
>
> I looked into this some time ago and tried to find some articles
> describing the MTBF (mean time between failure) of flash memory. Of
> course there are many claims that it lasts virtually forever, but that's
> what they said about CDROM's for years.
>
> From what I've read, MTBF for flash memory is between 1 million to 3
> million hours. Another source says that rewriting is more wearing to
> flash memory, thus it can withstand perhaps 500,000 to 1 million writes
> before the potential for failure increases.
>
> Also see http://www.embeddedintel.com/display.php?article=53, where the
> heading "boosting flash lifetime" appears.
>
> Some technology vendors use "wear-leveling" to improve MTBF of flash
> devices. See the QNX Flash File System Technology Development Kit
> brochure
> (http://partners.qnx.com/download/download/9465/flash_fsys_t dk.pdf), and
> the SanDisk wear-leveling white paper
> (http://www.sandisk.com/Assets/File/OEM/WhitePapersAndBrochu res/RS-MMC/WPaperWearLevelv1.0.pdf)
>
> Regards,
> Bill K.
Re: Mysql on flash-memory
am 21.09.2006 18:54:50 von Bill Karwin
dan wrote:
> Thanks for the interesting articles Bill,
>
> So now I need to calculate how many times a single physical bit on the
> flash get erased per day, assuming there is a wear-leveling mechanism
> in place to spread out the block erase evenly. Then I can work out the
> lifespan of the 64Mb flash card.
Also note in the articles about flash technology that erasing operations
are done in blocks, not at a bit or byte level. So I'm not sure what
happens when you try to erase or rewrite a tiny portion. Anyway, it
seems like flash memory isn't as flexible as hard disks or RAM regarding
addressing small quantities of information.
> My question now is much data MySql write to flash every second ? Given
> that the system updates one record of 500bytes every second. Will it
> cause MySql to write to flash 500 bytes per second, or will it cause
> MySql to write the whole file of 500Kbytes to flash every second ?
Depends on some settings that are under your control regarding caching.
You can get MySQL to keep most changes in memory, only flushing them
to "disk" occasionally.
Another solution you can do is to keep tables stored on the flash
initially, but then create MEMORY tables for doing the actual work, and
copy the memory tables back to the tables stored on flash at whatever
interval of time you want.
Regards,
Bill K.