2006-04-07, 02:24 PM
We all know Intel hyped this hyperthreading BS.. now there are some application that actually get improved performance with it on.. most things really don't though.. and even are slower with it on. In all my tests.. mysql is one of them. I used mysql bench and the standard /etc/my.cnf that comes installed with the rpms
HT on
Code:
alter-table: Total time: 11 wallclock secs ( 0.06 usr 0.03 sys + 0.00 cusr 0.00 csys = 0.09 CPU)
ATIS: Total time: 15 wallclock secs ( 5.16 usr 1.53 sys + 0.00 cusr 0.00 csys = 6.69 CPU)
big-tables: Total time: 11 wallclock secs ( 3.20 usr 3.04 sys + 0.00 cusr 0.00 csys = 6.24 CPU)
connect: Total time: 71 wallclock secs (25.68 usr 18.76 sys + 0.00 cusr 0.00 csys = 44.44 CPU)
create: Total time: 66 wallclock secs ( 4.96 usr 1.76 sys + 0.00 cusr 0.00 csys = 6.72 CPU)
insert: Total time: 793 wallclock secs (293.21 usr 85.55 sys + 0.00 cusr 0.00 csys = 378.76 CPU)
select: Total time: 353 wallclock secs (27.53 usr 8.26 sys + 0.00 cusr 0.00 csys = 35.79 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time: 6 wallclock secs ( 1.89 usr 0.86 sys + 0.00 cusr 0.00 csys = 2.75 CPU)
TOTALS 1327.00 356.15 118.16 474.31 3425950
HT off
Code:
alter-table: Total time: 11 wallclock secs ( 0.03 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.04 CPU)
ATIS: Total time: 14 wallclock secs ( 4.90 usr 1.56 sys + 0.00 cusr 0.00 csys = 6.46 CPU)
big-tables: Total time: 10 wallclock secs ( 2.77 usr 2.73 sys + 0.00 cusr 0.00 csys = 5.50 CPU)
connect: Total time: 63 wallclock secs (21.46 usr 17.05 sys + 0.00 cusr 0.00 csys = 38.51 CPU)
create: Total time: 65 wallclock secs ( 0.79 usr 0.46 sys + 0.00 cusr 0.00 csys = 1.25 CPU)
insert: Total time: 746 wallclock secs (268.72 usr 80.74 sys + 0.00 cusr 0.00 csys = 349.46 CPU)
select: Total time: 344 wallclock secs (25.08 usr 6.70 sys + 0.00 cusr 0.00 csys = 31.78 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time: 5 wallclock secs ( 1.79 usr 0.70 sys + 0.00 cusr 0.00 csys = 2.49 CPU)
TOTALS 1257.00 319.99 108.41 428.40 3425950
doing the math.. we see that mysql with HT off performs almost 6-7% better. So if you are looking to run a high volume SQL server.. turn HT off!