How can I optimize the speed and lifetime of SSDs used in a RAID-0?

Solution 1:

I would suggest not using RAID0 for good SSDs. A good modern SSD is unlikely to be your bottleneck for most real-world access patterns, at least not in a way RAID-0 is going to help a lot.

Unless of course you are linking a pair of drives together this way in order to have one large volume rather than two separate ones, rather than due to speed concerns...

Some SSD controllers will take writing a block of all 0s to mean that the block is free to be TRIMed (and instead of storing the location of the block in the appropriate index store a sentinel value that means "if you are asked for this block, just return a load of 0s"). If your drives do this then occasionally writing over your free space with 0s would help, using sdelete or similar in zero-only mode. Not terribly efficient of course, and make sure your drives will react this way otherwise you will be making the situation worse rather than better.