[ale] LAMP performance

Pat Regan thehead at patshead.com
Mon Sep 13 17:58:01 EDT 2010


On Mon, 13 Sep 2010 17:25:38 -0400
Greg Freemyer <greg.freemyer at gmail.com> wrote:

> > I think the biggest trick they use is the fact that 5-15% of the
> > drive isn't actually addressable (depending on make/model).
> 
> The purpose of the spare 5-15% is purely for performance, not
> lifetime.

The empty space is really only (theoretically) required for performance
if you don't want the speed to drop off as the drive gets full.  I
would hope a good algorithm would be buying you both performance and
longevity with those extra blocks.

It is pretty similar to how the default 5% reserved blocks on an
ext2/3/4 partition help prevent fragmentation.  That extra room gives
you the opportunity to make smarter choices about what you erase.

> Every SSD write pulls a physical EB (erase block) off of the Free EB
> queue and puts data on it.  Then a mapping table is updated so the SSD
> knows where to read the logical address from.
> 
> The old physical EB is then pushed onto the bottom of the EB queue.
> It has to be physically wiped before it is available to be pulled off
> the top.  That can take some number of millisecs.  So if 100% of the
> SSD were in use, the queue would be empty and the write operations
> would be waiting for available EBs all the time.  The end result is
> that a SSD is actually slower than a hard drive.
> 
> AIUI, most low cost thumb drives use the same technology but don't
> perform block erasing in the background.  Thus their extremely low
> performance.
> 
> SSDs like the Intel have the spare EBs sitting around so they can
> erase the EBs in the background, thus attempting to eliminate the
> erasing of blocks from being a bottleneck.
> 
> I don't know enough about how logical sectors are mapped to EBs to
> calculate the lifetime writes achievable in a good SSD like an Intel.
> It may depend on the exact number of sectors being written per write,
> etc.

I'm under the impression the the X25 and other current generation SSDs
are more granular than just relocating entire erase blocks.  That was
supposed to be one of the reasons the X25 was wiping the floor with the
the competition on small random writes.

Unfortunately, they're black boxes from our perspective.  Last time I
looked I was averaging something like 6 GB of writes per day on my
laptop when I was still running ext4 (I don't think btrfs is keeping
track).

The Intel SSDs had a firmware update a while back that gave a pretty
sizeable boost to their write performance.  I've been wondering if the
original firmware was more optimized for longevity and they realized
that they were being overly cautious.

File systems like ZFS are smart enough to work with fast and slow media
in the same pool.  You could effectively have an array of slower
spinning media to cover your reads and a pair of SSDs to cache your
writes.  I haven't gotten to play with this, though, so I don't know
how well it works in practice :)

Pat


More information about the Ale mailing list