It always surprised me how little Innodb team seems to think about product usability/ease of use, when it comes to settings, performance management etc.

I could understand many things 5 years ago, like a lot of information being available only in hard to parse SHOW INNODB STATUS output or even uglier hacks with creating tables such as innodb_lock_monitor to get more detailed information free space specified in table comments (which need to be parsed) etc. 5 years ago Heikki was along and he had a lot to do to make things work well so a lot of these things were just done quick and dirty way.

It is however hard for me to understand why so many years later with significantly increased team not only many of these things remain unfixed but things are still done similar way ?

Other the years variables like innodb_thread_concurrency were added with rather complicated history of changes for meaning of the values, which seems to now settled to more or less understandable with value 0 meaning disabling Innodb internal thread queuing.

Another one is innodb_flush_logs_at_trx_commit – initially it had only values 0 and 1 which was more or less obvious as 0 typically means “No” and 1 “Yes” in many MySQL options. When Value 2 was added which actually has a meaning between what 0 and 1 mean which is very hard to understand.

Proper way would be of course to use some string values which are more self explanatory so at least you can’t mix what do you currently have set in your my.cnf file – For example using values “none”, “disk”, “os” instead of 0,1,2 will be more explanatory.

Furthermore MySQL even has infrastructure to support both string and integer values, which would allow to preserve compatibility. Look for example on query_cache_type variable which can be set to ON/OFF/DEMAND as well as to 0 and 1.

Interesting enough in some cases Innodb team does get things right. innodb_flush_method variable does not use value 0,1,2,3,4,6 which you have to lookup in the manual each time, but it uses more understandable values such as O_DIRECT, O_DSYNC, fdatasync etc.

However Look at new variable innodb_autoinc_lock_mode freshly added in 5.1.22 (which is what motivated me to write this post) – looking at the manual
we again get values 0,1,2 which have to be translated to “traditional”, “consecutive” and “interleaved” ?

Using string values would make things much more friendly with my.cnf and “show variables” output being more obvious and self documenting.

14 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
rockerBOO

I agree with you on these. It has been really difficult to look over my innodb parameters, and get a good idea of what is happening in there.

Denis

Didn’t get u a bit. “not only many of these things are fixed” did u mean “not only many of these things are _not_ fixed” ?
like they remain unfixed or what?

Jay Janssen

I disagree that innodb_flush_method is simple. The deficiency in my mind is that it can change the open file options for either the innodb data files, *OR* the trx log files, but not both at once. I’d like it better if I could use O_DIRECT for my data files to prevent FS caching, and O_SYNC for my trx logs.

Kevin Burton

Hm… what’s the downside of using O_DIRECT wrt the write ahead log?

We’re considering the switch so that innodb doesn’t have to worry about the kernel pushing the buffer pool into the page file.

Jay Janssen

O_DIRECT doesn’t seem to affect the trx log, it applies to how inno opens the data files.

Kevin Burton

Peter. Good point.

So memlock + O_DIRECT seem to be required on Linux if you want to use all your memory and not page.

I still have to track down whether this is a bug in 2.6.18 or whether this is expected behavior.

Kevin

Alexander Kjäll

As far as i have understood it O_DIRECT makes linux not cache the data read from disk, this is a very small performance improvement and only holds true if you either don’t have any free memory to cache it in, or are sure you doesn’t read it again.

Here is an article with Linus Torvalds thoughts on O_DIRECT:

http://kerneltrap.org/node/7563

Kevin Burton

Alexander,

O_DIRECT can provide a huge performance boost since it can trick linux to NOT move the buffer pool into the page file.

Here’s my recent battle with innodb+linux

http://feedblog.org/2007/09/29/using-o_direct-on-linux-and-innodb-to-fix-swap-insanity/

Antony Curtis

The plug-in system available in MySQL 5.1+ permits the declaration of system variables as an ENUM which would easily allow defining variables, such as innodb_flush_logs_at_trx_commit, in a more human friendly way instead of just a number.

Alexander Kjäll

Kevin

Thanks you for clearing that up, it was a good read.