Skip to content

Instantly share code, notes, and snippets.

@dkilcy
Created March 8, 2015 15:15
Show Gist options
  • Save dkilcy/5046bb7a5c3fb8ee5629 to your computer and use it in GitHub Desktop.
Save dkilcy/5046bb7a5c3fb8ee5629 to your computer and use it in GitHub Desktop.
disk-write-performance.md
tune2fs -I 256 /dev/hda1

rw,noatime,barrier=1,data=ordered
commit=300

write caching    $ hdparm -W[01] /dev/sda

write barrier    barrier=[01] in /etc/fstab 

A write barrier is a kernel mechanism used to ensure that file system metadata is correctly written and ordered on persistent storage, even when storage devices with volatile write caches lose power. 
Enabling write barriers incurs a substantial performance penalty for some applications. Specifically, applications that use fsync() heavily or create and delete many small files will likely run much slower. 
Some system configurations do not need write barriers to protect data. In most cases, other methods are preferable to write barriers, since enabling write barriers causes a significant performance penalty. 

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-writebarriers.html
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/index.html

data=writeback mode
data=ordered mode
data=journal 

https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment