Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/
AMD64?
Till Plewe
till at score.is.tsukuba.ac.jp
Thu May 20 17:36:31 PDT 2004
On Thu, May 20, 2004 at 05:38:31PM -0400, Haapanen, Tom wrote:
> John-Mark Gurney [mailto:gurney_j at efn.org]:
> > 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...
>
> Right. Looking at my production server (dual Opteron 242) it looks like I
> have essentially been running MySQL on a single CPU, too, based on the ps
> output:
>
> root 11 0 0 0 RL ?? 61050:34.15 (idle: cpu1)
> root 12 0 0 0 RL ?? 65468:56.13 (idle: cpu0)
>
> The idle time in the ps output should conclusively prove to JG, too, whether
> both CPUs are actually being utilized.
>
> It sure doesn't look like the CPU time is evenly distributed across the two
> processors -- it looks like MySQL is running on CPU1 only.
>
> I'm happy to provide access to the box if that will help someone figure out
> what's going on with the threading.
>
> Tom
Are you running SCHED_ULE? I had a similar problem which vanished when I switched
back to SCHED_4BSD.
- Till
More information about the freebsd-amd64
mailing list