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

John-Mark Gurney gurney_j at efn.org
Tue May 18 16:12:37 PDT 2004


JG wrote this message on Tue, May 18, 2004 at 10:36 -0700:

[...]

> 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 

[...]

> 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

[...]

> 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

[...]

> Your databases overall average score is 3146.2522648084 records per second.

[...]

> So any suggestions on how to improve performance on FreeBSD/AMD64?

First you should be comparing the same version of MySQL...  who knows
what changes were made between versions that could seriously slow down
performance...  Maybe MySQL 4.1 adds table locking while 4.0 doesn't...

Second, you should be running with libthr or libkse (now known as
lib pthread), and not libc_r...  any benchmarks with libc_r is no
way to test 5.x...  This is due to the fact the libc_r runs with
only a single context, and uses at most, one cpu...  Running with
libthr or libkse will let you run on multiple processors at once...

considering that FreeBSD got over 50% the score on a single cpu
compared to Linux, that says quite a bit...  so, please link with a
proper thread library and run with the save version of the code before
you try to draw any conclusions...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-amd64 mailing list