Why is MySQL nearly twice as fast on Linux?
davidxu at freebsd.org
Sun May 23 16:58:12 PDT 2004
Thomas Hurst wrote:
>* David Xu (davidxu at freebsd.org) wrote:
>>I suggest you to do file system benchmark first, I suspect
>>-CURRENT file system's performance is far behind than Linux.
>The super-smack benchmarks we performed have minimal impact on
>filesystem; the tables are small enough to fit in cache, and systat
>shows clearly there's next to nothing touching the filesystem.
>We've tried the latest 5-RELEASE and -CURRENT as of a week or two ago;
>libkse (libpthread under current), libthr, libc_r and linuxthreads.
>System and process scope threads, linking explicitly at compile time to
>said libs and using libmap.conf. We've disabled HTT and tweaked
>everything we could think of with minimal change.
>I would say it *looks* like FreeBSD is only using 1 CPU, but threads are
>clearly distributed across them. Getting load >50% seems difficult,
>Given the number of threading libraries etc we've tried, I'm more
>inclined to point at scheduling or so. We did try SCHED_ULE once or
>twice with minimal difference. Maybe MySQL's just hitting a lot of
>(I'm Chris Elsworth's co-worker btw; the guy mentioned in the root of
>the thread :)
I have a little knowledge of MySQL, the default mysql table
type is mysql, when you update records on the table type,
it uses Giant lock, it does not support concurrent update,
so if you have SMP machine, it won't help you too much,
when your table is for write-most, you should create other
types of table, for example BDB or innodb etcs. I would expect
50%CPU usage when updating mysql table on SMP machine
despite that memory is large enough --- number of G bytes.
More information about the freebsd-threads