[mdlug] SSD - flashcache or bcache

Dan Pritts danno at dogcheese.net
Wed Jan 15 13:35:58 EST 2014


On Jan 13, 2014, at 10:56 PM, Aaron Kulkis <akulkis00 at gmail.com> wrote
> As I understand it, Compared to disks, when writing, the throughput to flash memory is slow.

Where you write “flash memory” I am going to assume you mean “SSD”, as SSDs are deployed in PC and server
hardware today.  Not raw chips, not cheap crappy USB thumb drives.  

A few early SSDs had controller “issues” that caused small random writes to be super-slow, once the disk had
filled once - erasing the cells causes some latency, and these controllers did not handle it well.  Also, writes of 
<4k (the flash cell size) can cause a slow “read-modify-write” cycle on the flash cell.  

Things are much better today.  The SSD is typically provisioned with extra flash internally and has much more 
intelligence in caching and layout.  The SATA “Trim” command helps a lot - the filesystem can advise the storage 
which blocks are no longer in use.  The storage can proactive erase these blocks to get them ready for re-use.  

In short, modern SSD’s with modern OS’s are fast as hell at writes, most of the time.    Some are faster than others.

> Flash memory is GREAT for things like directories like /etc, /bin, /sbin, /usr/bin, /usr/sbin,
> because the files in them are written VERY occasionally (software updates and configuration changes),
> and so there are al the advantages of a technology that eliminates the disk-drive associate
> delays of read/write head seek time and rotational delay.

Those benefits are huge on both reads and writes.  Browsing the web is faster with cache on an SSD.

Buy yourself an SSD, put it on your desktop/laptop, and be happy.

> Also, using flash for swap space is just going to wear out very expensive memory very quickly.

You are generally correct.  I would add however that swapping to SSD means the system may not be
totally unresponsive under memory pressure.  I would suggest that you make sure you have enough
ram that you almost never swap - then if you do swap you can do something about it.  

I have been using SSDs on my desktop systems in regular use for about 4 years now.  I have had one failure, 
due to a bad controller board.  No flash-wearing-out failures.  

Bottom line, it is possible you will wear it out.  But the vendors generally believe that you won’t, in the expected
life of the drive, at least not in desktop use.  And I don’t hear stories of people losing their drives.

I run an Oracle DB server with the DB totally on flash.  It helped performance quite a bit.  Enterprise SSDs 
are much more expensive per byte than consumer/desktop SSDs.  This is not because they perform  
especially better, but rather because they are significantly overprovisioned so they can deal with the 
write-heavy environment.  

danno


More information about the mdlug mailing list