Home
Arjen's Journal - HyperThreading? Not on a MySQL server...
Moved to http://openquery.com/blog/

Arjen Lentz
Date: 2006-06-14 21:45
Subject: HyperThreading? Not on a MySQL server...
Security: Public

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!

Post A Comment | 4 Comments | Add to Memories | Tell a Friend | Link



User: (Anonymous)
Date: 2006-06-19 21:11 (UTC)
Subject: Hm........

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

Reply | Thread | Link



User: (Anonymous)
Date: 2006-06-20 10:00 (UTC)
Subject: (no subject)

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).

Reply | Thread | Link



User: (Anonymous)
Date: 2006-06-20 10:02 (UTC)
Subject: (no subject)

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.

Reply | Thread | Link



browse
my journal
links
April 2009
High Performance MySQL (2nd ed.)
summary