Michal Hrušecký

...about me, Linux and OpenSource

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'.

 

Fstab Options

#1 Re: Barriers & ext4 & MySQL

Eliasse Diaite, <E-Mail> / Wednesday 04 November 2009 12:54pm  
avatar

Thank you very much for this information. You are really a good guy and this kind of contribution is what all users of openSUSE should make instead of complaining anytime they are confronted with a problem.
Have a lot of fun ...
openSUSE Linux is unbreakable.

[ Reply (0) ]

#2 Re: Barriers & ext4 & MySQL

Robin, <> / Wednesday 04 November 2009 1:28pm  
avatar

weren't barriers also enabled by default for ext3 in prior releases or was that only true for SLE?

[ Reply (1) ]

#2.1 Re: Re: Barriers & ext4 & MySQL

Michal Hrušecký, <E-Mail> / Wednesday 04 November 2009 3:53pm  
avatar

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.

[ Reply (0) ]

Leave a Comment

Write the captcha code you are seeing.

Comment XML feeds: RSS | Atom

Day against DRM

Identica

  • Installing Xen was really just a few clicks in Yast and reboot even on my !openSUSE factory computer!
    1 days ago :: link
  • Computers are mysterious. From time to time I found some files I never seen before just lying somewhere on my harddrive...
    1 days ago :: link
  • On my way to InstallFest. Today as a mere mortal, my talk is tomorow ;-)
    3 days ago :: link
  • Poor little Apple, they realized that somebody else is selling smartphones too? If you can't compete, just sue them http://tr.im/QoLp
    7 days ago :: link
  • ♻ "The only guy getting all work done by Friday was Robinson Crusoe"
    9 days ago :: link

Ohloh Journal for Michal Hrušecký

  • 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...
    16 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.
    18 days ago :: link
  • I was thinking about implementing methods as plugins in affisix for some time already. Today I committed the first revision containing some code regarding this feature. Everything else is in bad shape and quite broken but plugins already partially works.
    127 days ago :: link
  • Affisix repository has been migrated from svn to git. Hopefully everything works. At least it seems so from here... I'll update web page to reflect these changes someday, hopefully soon... Sometimes, all you need is hope :-D
    267 days ago :: link
  • I was working on something for project I mentioned before and I thought that I found a bug in handling of utf-8 in Affisix. But in the end, it was just font/displaying problem. Doing experiments on language I can't read has some disadvantages...
    275 days ago :: link

Emblems

Powered By Jaws Project
Supports RSS2
Supports Atom
Powered By openSUSE
Powered By Vim
Is Valid XHTML
Is Valid CSS
Is Valid RSS2