Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 2004 07:56:32 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Thomas Hurst <tom.hurst@clara.net>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Why is MySQL nearly twice as fast on Linux?
Message-ID:  <40B13A30.50503@freebsd.org>
In-Reply-To: <20040523172354.GA97724@voi.aagh.net>
References:  <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> <40AF4A8D.4020602@freebsd.org> <20040523172354.GA97724@voi.aagh.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Thomas Hurst wrote:

>* David Xu (davidxu@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,
>though.
>
>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
>locks *shrug*.
>
>(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.

David Xu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40B13A30.50503>