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

John-Mark Gurney gurney_j at efn.org
Thu May 20 10:10:19 PDT 2004


JG wrote this message on Thu, May 20, 2004 at 09:53 -0700:
> Is there some kind test I can run to find out if SMP is actually being used 
> efficiently or not?
> 
> John-Mark said something earlier about watching output of "vmstat -w 1" and 
> if the ID's don't
> drop below 20 then I am probably only using a single CPU. Well, I hope 
> that's not the case
> because I ran that while cvsup was compiling (it just finished) and the 
> ID's never dropped
> below 50.

Well, there is two parts to SMP, one is the OS seeing the CPU, which
is probably happening, since you don't see the idle time drop below
50%...  to check how many cpu's FreeBSd sees, run:
sysctl hw.ncpu
I get:
-bash-2.05b$ sysctl hw.ncpu
hw.ncpu: 2
On a dual proc box..

The next part is if the program makes use of either multiple processes,
or a threading library like libpthread that will support concurent threads
of execution...   This last part is the problem you are having...  There
seems to be a problem with libpthread not starting another kse (iirc)
to support the extra cpu...

You can run ps -H durning the mysql run, and you should see multiple
entries for the mysql daemon.

-- 
  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