Skip to content

Instantly share code, notes, and snippets.

@funivan
Last active December 16, 2015 09:29
Show Gist options
  • Select an option

  • Save funivan/5413315 to your computer and use it in GitHub Desktop.

Select an option

Save funivan/5413315 to your computer and use it in GitHub Desktop.
optimize ubuntu on ssd
sudo fstrim / -v
gksudo gedit /etc/fstab
# demo :
# UUID=aeade6fd-2b24-4e59-bc8c-6f1791338b0c / ext4 noatime,nodiratime,discard,errors=remount-ro,commit=60 0 1
# add this
# add this
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /var/log tmpfs defaults 0 0
# После этого стоит настроить отложенную запись — ядро будет копить данные,
# ожидающие записи на диск, и записывать их либо при
# острой необходимости, либо по истечении таймаута. Я ставлю таймаут на 200 секунд, кто-то — на 150.
# Для этого открываем /etc/sysctl.conf и добавляем параметры
gedit /etc/sysctl.conf
vm.laptop_mode = 5 // Включение режима
vm.dirty_writeback_centisecs = 20000 // время в сСк. Т.е. 100ед = 1секунда
# Disk head scheduler for SSDs
# A disk scheduler optimizes the order of disk requests by considering the position
# of the hard drive’s read/write head.
# An SSD needs no such optimization, so it’s best to use the noop (no-operation) scheduler.
#
# I switched to the noop scheduler for my SSD by adding the to following line to /etc/rc.local
# (replace sdb with your own SSD’s device node name):
echo noop > /sys/block/sda/queue/scheduler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment