4

I am running a very intensive MySQL query and noticed that only 1 core is being used to 100% while the other cores are idle. The system is running Ubuntu 12.04 and MySQL 5.5.28

Is there a way to force MySQL to use all cores?

enter image description here

Nyxynyx
  • 1,121
  • 6
  • 17
  • 28

1 Answers1

1

MySQL's implementation won't allow you to use more than one core per Server Thread.

I recommend divide-and-conquer strategy: break up your query in multiple (hopefully smaller, independent) jobs and start again.

LMC
  • 195
  • 1
  • 2
  • 11
  • MySQL 5.5 does allow multiple read and write IO threads. So does 5.1's InnoDB Plugin (starting for MySQL 5.1.38). I left comments in the question to my posts on this. However, I will give a +1 because your answer would only apply to anyone who wants to stick to versions of MySQL prior to 5.1.38, or any version of MySQL after 5.1.38 that does not have the InnoDB Plugin installed. Here is a youtube video that shows divide-and-conquer strategy using multiple mysqld processes ( http://www.youtube.com/watch?v=5uKBg9prA1A&feature=share&list=PL0194B59719B45A96 ). I used to recommend this. – RolandoMySQLDBA Mar 04 '13 at 16:37
  • @RolandoMySQLDBA I believe there's a misunderstanding here. MySQL won't divide a single query's work between different Server Threads, and one Server Thread won't ever use more than one CPU core at any given point-in-time. Therefore, if (as the question states) there's only one query to run, the maximum number of CPU cores a MySQL Server can get working on the problem is 1: one thread must take care of the query, and one CPU core will be used to run the process. – LMC Mar 05 '13 at 13:03