In message <[EMAIL PROTECTED]>, Mike Tancsa writes:

>I am working on our next rev of nanobsd and was looking to 
>incorporate FreeBSD's fifolog program for more persistent logging. It 
>seems to take care not to write out to flash too often so as to 
>reduce wear.  With modern day flashes, (I am using SanDisks), what 
>can I expect in terms of lifetime ?  Also, if I create a partition 
>just for the logs, and lets say I wear out part of the flash, will 
>there be any impact to my OS partition which is read only ?

Very pointed and relevant questions, which flash vendors absolutely
refuse to give us the data to answer.

It depends on the underlying flash chips quality, the wear-leveling
algoritm and how much free space it has to play with.

No matter what kind of wear-leveling, even the most idiotic, the
sequential write that fifolog does is close the optimal use case,
provided the space you write into is sequential seen at the "disk"
interface.  (That is why I prefer to use a partition for fiflogs)

If you know the write cycle lifetime spec for your card, the
best case lifetime is:

        Nsectors * write_rate * write_cycles = lifetime

If you fill in with some numbers:

        128k [sector] (=64MB) * 10 [seconds/write] * 20000 [writes/sector]

        = 26214400000 [seconds] = 830 [years]

For most people, that leaves plenty of margin, but if you are not
happy with that, allocate more space or reduce the write rate.

The other thing to keep in mind is how long time you have your
log data available:

        128k [sector] * 10 [seconds/write] 

        = 1310720 [seconds] 15 [days]

Depending on your syslog, you may not be able to keep the write rate
down, so allocating more space would be the best bet.

In the original application, we have 3.5GB fifolog space, and I'll
leave the calculations of lifetime as an exercise for the reader :-)

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech

Reply via email to