MySQL Optimizations on Linux
Posted on 12 September 2008 by Abidoon
It is important to optimize all pieces of the LAMP acronym and MySQL is not exception to the rule when deploying on the live servers
Here be the compile time flags.
export CFLAGS=”-O3 -march=cpu -pipe -msse2 -m3dnow -fomit-frame-pointer -mtune=cpu” CXX=gcc CXXFLAGS=”-O3 -cpu -felide-constructors -fno-exceptions -fno-rtti”
As mentioned in my previous entry you can go check the GCC Manual pages to replace the cpu keyword in the mtune and march in the CFLAGS and the -cpu in the CXXFLAGS.
I got approximately a 5% performance boost with these during benchmarking.
Please note though that the developer team got a much bigger increase in performance when they optimized the tables by adding indexes and improving their queries.
In general we also found that a simple select query took about twice as much time when the table was using InnoDB compared to MyISAM.
I am open to any additional feedback and ideas anyone may have.
