On Tue, May 19, 2015 at 11:22 AM,  <gottl...@nyu.edu> wrote:
> On Tue, May 19 2015, Peter Humphrey wrote:
>
>> On Tuesday 19 May 2015 10:53:26 Rich Freeman wrote:
>>> On Tue, May 19, 2015 at 10:44 AM, Peter Humphrey <pe...@prh.myzen.co.uk>
>> wrote:
>>> > Incidentally, what's the received wisdom on frequency of file-system
>>> > trimming on SSDs these days? I've seen values quoted between twice a day
>>> > and once a week. And how does trimming affect btrfs?
>
> I included "discard" in fstab for my ssd filesystems, presumably
> following some installation guide.  For example I have
>
>   /dev/sda5         /         ext4    noatime,discard   0 1
>   /dev/vg/local     /local    ext4    noatime,discard   0 2
>
> Is it preferred to instead issue explicit trim's via cron?
>

It depends.

In theory giving your drive useful information about allocation now is
better than giving it the information later.  The drive can make use
of that information to improve performance.

In practice some drives have brain-dead firmware and they'll do stupid
things with that information.  If you trim part of an erase block, the
drive should just file that info away and make use of that information
when it can.  However, some drives will immediately copy/erase the
rest of the block at that moment, which creates an unnecessary erase
cycle and creates IO load at a moment that the drive is already busy.

So, if your drive isn't brain-dead discard is better.  If your drive
is brain-dead fstrim is almost as good if the drive isn't too full.
I've yet to test discard and see how well it works.

-- 
Rich

Reply via email to