On Wed, 2005-03-02 at 20:52, Faisal Feroz wrote:
> Hello All,
>
> We recently ran a few tests on mysql on both solaris and linux
> environments. It turned out that mysql was much faster and responsive
> on linux. After doing some digging, we found out one of the possible
> reasons is the fact that mysql source code uses malloc all over the
> place.
Faisas,
Could you please clarify which benchmark did you use ?
We have not seen dramatic performance difference between Linux and
Solaris in our benchmarks as well as some other benchmarks published:
http://www.newsforge.com/article.pl?sid=04/12/27/1243207
We also have been working on lock analyses in MySQL and never seen any
malloc() related locks reported in the top hot spots.
Also even though MySQL uses malloc() it has its own memory allocation
for small memory allocation - these are which normally hurt the most.
I've did a while benchmarks using libhoard with MySQL as well as some
commercial alternatives but did not get any notable performance
improvement.
>
> On solaris malloc calls block all threads and create heap contention.
> Indeed, Sun actually dis-courages the use of malloc. This would explain
> why we could never see our CPU utilization go up on solaris.
Well, contention should result in different behavior. You should have
gotten at least one CPU well used with large number of context switches
due to lock waits.
Might be the problem is actually the way Disk IO is handled ? Are you
using Innodb ?
One of the cases when Solaris is indeed much slower is transactional
workload. Solaris by default disables write cache on ATA/IDE devices
while Linux had it enabled. This can result in performance being
different 10 times or more for short transactions. The Linux way
however in such case does not really give you ACID guaranties one would
expect.
>
> Question #1) are we right in our assumption that mysql runs way faster
> on linux rather then solaris or are we on drugs.
> Question #2) If it does indeed run faster, is there a way or a ported
> binary of mysql that runs equally fast on Solaris. Reason being I have
> two big Sun E3500 lying around that I would like to put to good use ..
If you could report which benchmark did you use (so we can repeat your
run) as well as share the actual data we could investigate what the
problem is and possibly fix it.
--
Peter Zaitsev, Senior Performance Engineer
Come to hear my talk at MySQL UC 2005 http://www.mysqluc.com/
MySQL AB, www.mysql.com