Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64?

Brooks Davis brooks at one-eyed-alien.net
Tue May 18 16:12:09 PDT 2004


On Tue, May 18, 2004 at 10:36:12AM -0700, JG wrote:
> 
> Well, I've finally got some initial benchmarks here...
> 
> I plan to do many more and encourage anyone who wants to see FreeBSD 
> perform better
> in these benchmarks to give me tips or suggestions to help boost 
> performance.
> 
> The benchmarks were done from a remote server on the LAN, using myBench.
> Unfortunately, myBench doesn't seem to simulate actual real-world user 
> loads.
> Super-smack does, but I ran into problems compiling it, and then more when 
> trying
> to use it remotely. Super-smack-1.3 is supposed to be coming out soon, 
> hopefully
> it will fix some of these problems.
> 
> Anyway, on with the benchmark results...
> 
> 
> TESTING HARDWARE:
> 
> Dual AMD Opteron 240's (1.4ghz)
> Tyan S2882UGNR server-class motherboard w/LSI Zero channel Raid card.
> 2 gigs PC-2700 registered ECC memory
> Seagate barracuda ATA 100 system drive
> RAID-0 Mysql drive composed of 2 15k RPM U160 SCSI Fujistu drives.
> 
> 
> BENCHMARK SUMMARIES:
> 
> (I ran the benchmark 5 times for each OS config, highest overall results 
> are listed below)
> 
> -----------------------------------------------------------------------------
> For:
> 
> LINUX MANDRAKE 10.0 RC1 w/"OUT OF THE BOX" MySQL installation
> MySQLd Ver 4.0.18 for mandrake-linux-gnu on x86_64 (Source distribution)
> Linux amd64m 2.6.3-9mdksmp #1 SMP Mon Apr 19 10:48:13 CEST 2004 x86_64 
> unknown unknown GNU/Linux
> 
> Benchmark results:
> 
> Generating 500000 records...
> Creation of 500000 records took 89 seconds.
> Average of 5617.9775280899 records per second.
> Creating records for 10 seconds...
> Created 50547 records in 10 seconds.
> Average of 5054.7 records per second.
> Creating random 50000 md5 hash records.
> Creation of 50000 random md5 hash inserts took 9 seconds.
> Average of 5555.5555555556 records per second.
> Creating random md5 hash records for 10 seconds...
> Created 50864 random records in 10 seconds.
> Average of 5086.4 records per second.
> 
> Your databases overall average score is 5328.6582709114 records per second
> -----------------------------------------------------------------------------
> 
> For:
> 
> FreeBSD  5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue May 18 07:17:39 PDT 2004
> using  kernel compiled with SCHED_ULE
> MySQL Ver 4.1.1-alpha for portbld-freebsd5.2.1 on amd64 (FreeBSD port: 
> mysql-server-4.1.1_2)
> MySQL Statically compiled with libc_r
> 
> Benchmark results:
> 
> Generating 500000 records...
> Creation of 500000 records took 155 seconds.
> Average of 3225.8064516129 records per second.
> Creating records for 10 seconds...
> Created 29121 records in 10 seconds.
> Average of 2912.1 records per second.
> Creating random 50000 md5 hash records.
> Creation of 50000 random md5 hash inserts took 15 seconds.
> Average of 3333.3333333333 records per second.
> Creating random md5 hash records for 10 seconds...
> Created 33121 random records in 10 seconds.
> Average of 3312.1 records per second.
> 
> Your databases overall average score is 3195.8349462366 records per second.
> 
> -----------------------------------------------------------------------------
> 
> For:
> 
> FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue May 18 07:17:39 PDT 2004
> using SCHED_4BSD
> MySQL Ver 4.1.1-alpha for portbld-freebsd5.2.1 on amd64 (FreeBSD port: 
> mysql-server-4.1.1_2)
> MySQL Statically compiled with libc_r
> 
> Benchmark results:
> 
> Generating 500000 records...
> Creation of 500000 records took 164 seconds.
> Average of 3048.7804878049 records per second.
> Creating records for 10 seconds...
> Created 33220 records in 10 seconds.
> Average of 3322 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 26428 random records in 10 seconds.
> Average of 2642.8 records per second.
> 
> Your databases overall average score is 3146.2522648084 records per second.
> 
> -----------------------------------------------------------------------------
> 
> And I think those Linux results could probably go up more with tweaking 
> figuring that was "stock".
> 
> 
> 
> So any suggestions on how to improve performance on FreeBSD/AMD64?

The obvious place to start would be to use ANY threading libarary other
then libc_r.  Any of libpthread, libthr, or linuxthreads should yeild
significantly better performance.  You may need to upgrade to -CURRENT
for those to work though.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20040518/09787b0a/attachment.bin


More information about the freebsd-amd64 mailing list