I've got a dedicated production server with multiple CPUs and 16GB of RAM.

How can I configure it to take advantage of server resources for better performance? Website traffic is increasing and MySQL starts using a lot of CPU.

This is my current MySQL server configuration.

I am also planning to optimize the database, and check the queries to improve the slow ones.

  • First, it seems reasonable to follow the hints in your config file and set those parameters accordingly. Second, I think I would start the other way round, and identify bottleneck queries first, improve their performance (including denormalization if necessary) and then fine tune the system resource usage. Jun 1, 2012 at 10:02
  • Do you primarily use MyISAM or InnoDB? Or both? Jun 1, 2012 at 10:18
  • If you have a RAID controller with battery backed cache, I would suggest adding: innodb_flush_method = O_DIRECT to your config. Jun 2, 2012 at 15:00

2 Answers 2


Please keep in mind that prior to MySQL 5.1.38, InnoDB was not designed to access multiple CPUs. You have one of two options to get MySQL to take advantage of multiple CPUs.

  • OPTION 1 : Install MySQL 5.5
  • OPTION 2 : Install MySQL 5.1 InnoDB Plugin

There are new options available since MySQL 5.1.38 (InnoDB Plugin Only) that is now fully available in MySQL 5.5

Rather rewrite what I wrote in past posts about this subject, please reads my past posts discussing those new settings:

As for tuning all other aspects of MySQL, please refer to my past post about looking into disk space management and storage engine tuning : MySQL 5.1 InnoDB Configuration / 24GB RAM - bi-xeon high load


Percona, a leading MySQL support and consulting company, offers a MySQL configuration wizard. It asks several questions, and produces my.cnf file based on your answers. It's a good starting point, and should produce somewhat safe values.

Several people from Percona offer wrote a book called "High Performance MySQL". The third edition was recently released, and covers tuning in great detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.