-
"Anime can turn people into adults, can't it?" - Sasahara (Genshiken OVA)
Barriers & ext4 & MySQL
We are going to release openSUSE 11.2 soon, so I want to let you know about one problem you may expect. One of the openSUSE 11.2 features is support for ext4. Well, if you will just click on next all the time during the installation, default filesystem for your root partition will be ext4. What is the problem with that? Well, ext4 in current kernel has barriers enabled by default. It's not a problem, it's a feature, but it has some unpleasant side effects which you may encounter. Let's take a closer look.
Barriers
Barriers are used to make sure that journal is really written to your filesystem and that nothing is missing. It has one big advantage - your data are safe. On the other hand it has disadvantage as well. You have to make sure that everything is written so you can't really take full advantage of all caches and such. There is a nice article on LWN.net about barriers.
Consequences
Well and why I mention it? Barriers has some impact on performance. Sometimes this impact can be quite notable as mentioned in bug #549534. This bug was about importing some sample 1.6M SQL dump into MySQL. One friend reported this to me on IRC. On ext4 with barriers enabled this import takes 527 seconds. But after disabling barriers on the same machine same SQL dump can be imported in 21 seconds. So if you plan using MySQL for some large and heavily used database and you have UPS or something similar you may consider disabling it.
Disabling barriers
So if you want to disable barriers, you ca easily do so by using barrier=0 in mount options. You can do it by adding this option after comma to the fourth column in your /etc/fstab. Or if you want something user friendlier, run 'yast2 disk', select your partition, using right click choose to Edit it and in following dialog use Fstab Options to invoke another dialog. In Fstab Options dialog, enter barrier=0 to the Arbitrary option value field. If you can't find it, follow the screenshot or run YaST in English by using 'LANG=C yast2 disk'.

Leave a Comment
Search
Blog Archive
Identica
- Announcing start of !openSUSE pastebin: http://bit.ly/avru2V Do you want pastebin with !openSUSE Bento theme? Try http://susepaste.org8 hours ago :: link
- ♻ @C3rvajz: !openSUSE Live! is back! Now accessible through native IPv6 protocol :) openSUSE 11.3 is ready here http://live.opensuse.org/13 hours ago :: link
- @lentulius You can use zypper, which is even better (one easy tool instead of several complicated ones ;-) )3 days ago :: link
- I hate computers. They pretend to be obedient, predictible and logical, but they know how to play a prank!4 days ago :: link
- Michal is scared of all these e-mails he has to read and write now :-(11 days ago :: link
Ohloh Journal for Michal Hrušecký
- Article about Affisix was acceptet for ITAT 2010! Time to fix everything that reviewers complained about!36 days ago :: link
- Abstract for ITAT2020 about Affisix sent, working on the article now...66 days ago :: link
- Just commited basit filter mode support to the Affisix repository. It is still missing a lot of features, but the basics are already there!92 days ago :: link
- One more note about affisix - backward entropy works now as well. So after school exams, I can start implementing new features and fixing broken ones...159 days ago :: link
- Yesterday I finally convinced affisix to do something after the change of internals. Forward entropy works, everything else is broken, but it's just a beginning ;-) Hopefully new features will emerge soon.161 days ago :: link








# Re: Re: Barriers & ext4 & MySQL
I think barriers were enabled by default also in openSUSE 11.1 for ext3 and it was the reason why we achieved bad results in some benchmarks. Back then it was SUSE enhancement to enable barriers on ext3 by default. In 11.2 barriers are disabled by default for ext3 and enabled by default for ext4. This is the same as in upstream kernel.