I have installed OpenSuse 11.3 32 Bit in a virtual machine on an older computer on a Windows XP host and on a new computer with AMD Phenom II X4 965 processor.
With sysbench I tested the performance of mutex and on the new computer it is 3 - 4 times slower than on the virtual machine. Other performance tests with sysbench for CPU, memory and threads are faster on new computer like expected. I tested this, because I have a slower performance of table creation in MySql tested with sql-bench, where creation of 10000 tables lasts 45 seconds on the virtual machine but over 400 seconds on the new computer.
I have tested with kernel-desktop and kernel-default but there are not large differences. File creation was tested with bonnie++ and is on newer computer faster as expected.
My questions are:
Why is the mutex handling on the multi core CPU slower than in the virtual machine and how to speed up this?
Or is there another reason why table creation of MySql is so much slower on multi core CPU?
I got confirmation, that slow mutex handling slows MySql table creation on multi core CPUs.
So I would like to ask again if someone has a hint for me to get faster mutex handling? Do I have to create a new kernel of my own with special settings and is there a description anywhere in www? Or are there other possibilities to reach this?
On 11/16/2010 12:06 PM, PgmHelmi wrote:
>
> I got confirmation, that slow mutex handling slows MySql table creation
> on multi core CPUs.
> So I would like to ask again if someone has a hint for me to get faster
> mutex handling? Do I have to create a new kernel of my own with special
> settings and is there a description anywhere in www? Or are there other
> possibilities to reach this?
There might be some configuration parameters that you could change; however, you
will certainly need to build a special kernel.
My first thought is that if there were any “low-hanging fruit” that would speed
up something as fundamental as mutex handling, it would have been done a long
time ago. The way you phrased your question suggests to me that your skill set
is not likely to support major kernel hacking.
You should try the 2.6.37-rcX kernel. There are a number of features that help
speed it up. One is the elimination of the Big Kernel Lock. The BKL was
installed when Linux first started supporting SMP. The developers have been
substituting finer-grained locking and finally reached the point where it can be
eliminated on most systems. A second feature of 2.6.37 is a change in the
scheduler. See http://www.phoronix.com/scan.php?page=article&item=linux_2637_video&num=1 for
details. Those changes now require patching the kernel, but will probably become
standard very soon.
Thanks for your answer! Now I know at least, that own kernel creation could be the way to solve my problem. You are right when you think that I am not a kernel expert because I am working with Linux only some months. But may be I want to learn to create a new kernel, if I have more time or I wait till next version of OpenSuse.
While people on this forum always try to be helpful, some specific questions are better asked elsewhere where the real gurus are hanging around. In your case I would suggest to post on the general mysql mailing list: MySQL Lists.
I did this before and there I got confirmation about slow mutex handling as reason for MySql performance. As slow mutex handling is dependent from operating system or kernel and in my case on multi core CPUs I thought here is the right place to ask. Also not only MySql but all other applications with heavy mutex handling suffers from it. Therefore I am glad I got an answer here.
Thanks for your attention. I left out details because I concentrated on the mutexes. I am using last MySql community version from openSUSE BuildService database, which is currently 5.1.52. glibc Version is 2.11.2. In 5.1 manual there is no part about glibc like in your link to the 5.0 manual. So my assumption is that this is not relevant anymore.