Swapping consistency for speed
Let's learn how to make your data disposable!


∗∗∗THIS WILL EAT YOUR DATA, ONLY DO THIS IF YOU ARE SURE OF THE CONSEQUENCES∗∗∗


Now that the scary warning's out of the way we can be honest. There are plenty of situations where using the changes below can be appropriate especially given the recent popularisation of immutable infrastructure.

I typically use these changes on throwaway vagrant machines where you don't want to burn cycles on your expensive SAN for VMs that can be redeployed in seconds.

Some examples of the use-cases that I have found to be appropriate:

Kernel

> cat /etc/rc.local
echo 50 > /proc/sys/vm/dirty_ratio
echo 50 > /proc/sys/vm/dirty_background_ratio
echo 60000 > /proc/sys/vm/dirty_expire_centisecs
echo 60000 > /proc/sys/vm/dirty_writeback_centisecs

Documentation can be found at https://www.kernel.org/doc/Documentation/sysctl/vm.txt

Filesystem

> cat /etc/rc.local
/bin/mount -o remount,noatime,nodiratime,nobh,nouser_xattr,barrier=0,commit=600 /
echo noop > /sys/block/vda/queue/scheduler

Documentation can be found at http://linux.die.net/man/8/mount

Mysql

> cat /etc/mysql/my.cnf
innodb_checksums=0
innodb_doublewrite=0
concurrent_insert=2
innodb_flush_log_at_trx_commit=0
innodb_flush_method=nosync

Documentation can be found at http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html

Insufficient resolution detected

This site is designed for a minimum horizontal resolution of 1250 pixels.
If you are using tablet you may be able to resolve this by turning it to a landscape orientation,
otherwise you can continue using the button below but the site may not work as intended.

Continue