(Risky) optimization for ext4 partitions

General discussions
Locked
tamalet
Posts: 490
Joined: Fri Sep 24, 2010 4:34 am

(Risky) optimization for ext4 partitions

Post by tamalet »

As some of you may know, at some point in the development of the kernel 2.6.32 there was a change that had a big impact on some applications, specially databases: http://www.phoronix.com/scan.php?page=a ... _now&num=6
The change is meant to avoid some possible data loss in the event of a power outage. So there is a reason for these changes, but they can be reverted with the nobarrier option when mounting the partition.

I did a simple test to see if there was any difference for Guayadeque. I measured the start up time, first cold and then 3 times more with
time guayadequeAfter the slash screen disappeared I close Guayadeque manually, so the tests are not very scientific.
Nomal configuration:
real 0m25.610s
user 0m2.540s
sys 0m0.710s

real 0m5.720s, 0m5.644s, 0m5.730s
user 0m2.100s, 0m2.060s, 0m2.080s
sys 0m0.520s, 0m0.560s, 0m0.550s

Optimized configuration:
real 0m20.144s
user 0m2.650s
sys 0m0.620s

real 0m5.470s, 0m5.408s, 0m5.531s
user 0m2.140s, 0m2.140s, 0m2.250s
sys 0m0.480s, 0m0.500s, 0m0.390s
As you can see there is an improvement, but it's not mind blowing. I did not try (yet) to see if there was a noticeable difference while using it.

Before I show the fstab configuration I want to emphasize that there is a reason for these changes in the kernel, there is a real possibility of loosing data if your computer is turned off while writing. I will try it on my laptop which can use the battery in case of a power outage and it is where an improvement in performance may be noticeable.If you use it, do it at your own risk!

To do the change, edit the fstab:
sudo gedit /etc/fstab
Look for your linux or home partition, mine looks like
UUID=446f607e-fdcb-4b7f-9b18-b94c7b29f578 /home ext4 defaults 0 2
and change it to something like this
UUID=446f607e-fdcb-4b7f-9b18-b94c7b29f578 /home ext4 defaults,noatime,data=writeback,commit=90,nobarrier 0 2
If you don't know what fstab is or you don't know which your linux partition is then stay away from this :)
Locked