2015年10月7日 星期三

SSD optimizing in linux

If your are using ext4 as file system in SSD, you may consider add discard and noatime parameter in /etc/fstab.
discard makes it trim. And noatime makes it not modify the last read time information for file.

And you can change CFS i/o scheduler to noop scheduler.
The approach is to modify the /etc/default/grub, add elevator=noop in kernel parameter.
And do
update-grub
Or if you have many storage devices not only SSD but also motion driven devices, you can  edit or create a file in
/etc/udev/rules.d/60-schedulers.rules
contains
# set noop scheduler for non-rotating disks 
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop" 
# set cfq scheduler for rotating disks 
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
And use
cat /sys/block/sda/queue/scheduler
to see the scheduler status.

沒有留言:

張貼留言