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

Peter Wemm peter at wemm.org
Wed May 19 12:12:09 PDT 2004

On Wednesday 19 May 2004 10:29 am, John-Mark Gurney wrote:
> JG wrote this message on Wed, May 19, 2004 at 06:07 -0700:
> > At 04:53 PM 5/19/2004 +0400, you wrote:
> > >In first time you built MySQL statically.
> > >Now - dinamically.
> > >
> > >What results with statical linked MySQL ?
> > >
> > >JG wrote:
> >
> > Those results are in earlier posts of this thread.
> >
> > I compiled it dynamically to be sure that libpthreads was used.
> > (so I could use ldd against mysqld)
> There is a patch to make use of _SYSTEM scoped threads instead of
> process scoped threads for mysql mentioned ealier..  Also, if you
> use libmap to remap libpthread to libthr, you'll have similar
> results...

Actually, the patch was the other way around.  mysqld was running into 
limits of system scope threads, so the port has patches to turn it into 
process scope.  It might be worth deleting the file from the port and 
rebuilding, just to see what happens.  However....

> libpthread (aka libkse) is a design for M:N threads, and requires
> the user of pthreads to create new system scoped threads to make
> use of multiple cpu's...

Not quite.  The default N in the M:N case for libpthread 'ncpu'.  
pthread_getconcurrency()/pthread_setconcurrency() can check and change 
this.  Of course, this is fine in theory - libpthread *should* be 
scheduling threads on all cpus at once.  But the numbers earlier in the 
email thread suggest otherwise.  So much for theory...

BTW:   your suggestion to try libthr isn't really helpful here.
peter at daintree[12:01pm]~lib/libpthread/thread-255> ls /usr/lib/libthr*
ls: No match.

Somebody mentioned MD patches for libthr at one point, but I haven't 
seen them.

Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5

More information about the freebsd-amd64 mailing list