Posted on 4 Comments

HyperThreading? Not on a MySQL server…

Did you know that… using a CPU with HyperThreading turned on actually makes your MySQL database server slower?

Reason… Well, with real multi-core or multi-CPU, MySQL’s connection threads get nicely spread. With HT it looks like you have multiple cores, but you don’t really. This possibly causes more overhead given MySQL’s multi-threaded architecture? Perhaps others have more insightful clarifications. Anyhow, HT makes things slower on a MySQL server system. Just turn it off and you’ll see!

Posted on 4 Comments

4 thoughts on “HyperThreading? Not on a MySQL server…

  1. Are you sure? We enabled the hyperthreading scheduler in the past and saw a speed boost for our app…….

    The Hyperthreaded scheduler handle schedling better because it knows that these aren’t real CPUs.

    Kevin

  2. It all depends on the load. I have a server that runs slower with HT turned on. After profiling it (using oprofile utility) I’ve found out that filesystem calls overhead is what actually caused slowdowns (even if all data fits in cache, there are lots of syscalls involved, and HT version with SMP kernels has more locks that are optimized away when compiling UP kernel).

  3. Also, there’s a feature called CPU affinity (I think it’s usable both on Linux and Windows), which lets you bind a process and all its descendants (threads) to a single CPU. That will let your other programs benefit from HT, without slowing down MySQL at all.

Comments are closed.