Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 2004 04:51:47 -0700
From:      JG <amd64list@jpgsworld.com>
To:        freebsd-amd64@freebsd.org
Subject:   Re: Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64?
Message-ID:  <5.2.0.9.2.20040519044815.0156fbb8@mail.ojoink.com>
In-Reply-To: <5.2.0.9.2.20040518170424.03c42748@mail.ojoink.com>
References:  <200405181359.18291.peter@wemm.org> <5.2.0.9.2.20040518103357.04c6cbb8@mail.ojoink.com> <5.2.0.9.2.20040518103357.04c6cbb8@mail.ojoink.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>>
>> > MySQL Statically compiled with libc_r
>>                                                              ^^^^^
>>That's your killer.  You're using the the single-process polling loop
>>based threads and comparing it to linux's parallel process based
>>threads.  The moment one thread blocks on disk IO, everything stops.
>>
>>You want -lpthread instead, but this isn't going to be happy on
>>5.2.1-RELEASE.  I've fixed a lot of bugs in 5-current that would mean
>>the difference between it working versus crashing.
>>
>>Also, there are patches to change MySQL to use PTHREAD_SCOPE_PROCESS
>>threads with -lpthread.  This works out a little better on benchmarks
>>since it can make better use of the ligher weight context switches.
>>
>>--
>>Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
>>"All of this is for nothing if we don't go to the stars" - JMS/B5
>
>
>Yes I'll definitely try this next.
>
>Thanks to everyone for all the tips & suggestions.
>
>I'll post some updated results tomorrow sometime.


More testing results... results still pretty much the same:

-----------------------------------------------------------------------------
Testing configuration:


FreeBSD amd64f.attbi.com 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue May 18 
07:17:39 PDT 2004
KERNEL OPTIONS: SCHED_4BSD,

Configure options I used in makefile:
CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
                 --without-debug \
                 --without-readline \
                 --without-libedit \
                 --without-bench \
                 --without-extra-tools \
                 --without-libwrap \
                 --without-mysqlfs \
                 --without-vio \
                 --with-low-memory \
                 --with-comment='FreeBSD port: ${PKGNAME}' \
                 --enable-thread-safe-client

OTHER PORT OPTIONS USED: BUILD_OPTMIZED=yes BUILD_STATIC=yes

MySQL Version Ver 4.1.1-alpha for portbld-freebsd5.2 on amd64 (FreeBSD 
port: mysql-server-4.1.1_2)

MySQL Statically compiled with:
libpthread.so.1
libz.so.2
libcrypt.so.2
libstdc++.so.4
libm.so.2
libc.so.5



RESULTS BELOW:
-----------------------------------------------------------------------------

Generating 500000 records...
Creation of 500000 records took 177 seconds.
Average of 2824.8587570621 records per second.
Creating records for 10 seconds...
Created 32603 records in 10 seconds.
Average of 3260.3 records per second.
Creating random 50000 md5 hash records.
Creation of 50000 random md5 hash inserts took 17 seconds.
Average of 2941.1764705882 records per second.
Creating random md5 hash records for 10 seconds...
Created 24109 random records in 10 seconds.
Average of 2410.9 records per second.

Your databases overall average score is 2859.3088069126 records per second.


Same config, using SCHED_ULE instead:

Generating 500000 records...
Creation of 500000 records took 156 seconds.
Average of 3205.1282051282 records per second.
Creating records for 10 seconds...
Created 31062 records in 10 seconds.
Average of 3106.2 records per second.
Creating random 50000 md5 hash records.
Creation of 50000 random md5 hash inserts took 14 seconds.
Average of 3571.4285714286 records per second.
Creating random md5 hash records for 10 seconds...
Created 30214 random records in 10 seconds.
Average of 3021.4 records per second.

Your databases overall average score is 3226.0391941392 records per second.











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