Re: Progress on scaling of FreeBSD on 8 CPU systems



On Sun, Feb 25, 2007 at 08:22:39PM +0100, Jeremie Le Hen wrote:
Hi, Kris,

On Sat, Feb 24, 2007 at 04:55:08PM -0500, Kris Kennaway wrote:
Now that the goals of the SMPng project are complete, for the past
year or more several of us have been working hard on profiling FreeBSD
in various multiprocessor workloads, and looking for performance
bottlenecks to be optimized.

We have recently made significant progress on optimizing for MySQL
running on an 8-core amd64 system. The graph of results may be found
here:

http://www.freebsd.org/~kris/scaling/scaling.png

This shows the graph of MySQL transactions/second performed by a
multi-threaded client workload against a local MySQL database with
varying numbers of client threads, with identically configured FreeBSD
and Linux systems on the same machine.

I'm really glad to be looking at these results eventually. Thanks to
all FreeBSD committers.


The test was run on FreeBSD 7.0, with the latest version of the ULE
2.0 scheduler, the libthr threading library, and an uncommitted patch
from Jeff Roberson [1] that addresses poor scalability of file
descriptor locking (using a new sleepable mutex primitive); this patch
is responsible for almost all of the performance and scaling
improvements measured. It also includes some other patches (collected
in my kris-contention p4 branch) that have been shown to help
contention in MySQL workloads in the past (including a UNIX domain
socket locking pushdown patch from Robert Watson), but these were
shown to only give small individual contributions, with a cumulative
effect on the order of 5-10%.

MySQL uses gettimeofday(2) very often. ISTR it has been stated
that MySQL performances could make the most of a system-wide shared
page where the current time would be updated regularly by the kernel;
gettimeofday(2) could consequentely work without any context switch.

Do the patches you're talking about include such a feature already ?

No, but when we tried hacking up gettimeofday last year to see what
effect the reduction of syscalls had, it didn't make a lot of
difference (at the time there was a theory that this was a major
source of the performance difference between freebsd and linux here).

It would still be worthwhile to explore implementing such a thing,
because it could give some incremental improvements, which are now
becoming more interesting to explore for this workload.

Kris

Attachment: pgp9HWFdUt3O2.pgp
Description: PGP signature



Relevant Pages

  • Re: Progress on scaling of FreeBSD on 8 CPU systems
    ... year or more several of us have been working hard on profiling FreeBSD ... We have recently made significant progress on optimizing for MySQL ... contention in MySQL workloads in the past (including a UNIX domain ...
    (freebsd-current)
  • Re: Progress on scaling of FreeBSD on 8 CPU systems
    ... year or more several of us have been working hard on profiling FreeBSD ... We have recently made significant progress on optimizing for MySQL ... contention in MySQL workloads in the past (including a UNIX domain ...
    (freebsd-hackers)
  • Re: Fine grain select locking.
    ... This patch also uses a vm zone for the selfd structures. ... We do best at optimizing where we have clearly defined targets and measures of performance. ... The four-times increase in MySQL select performance is a direct result of Kris taking on scalability measurement and helping developers with optimization ideas try them out, profile them, etc. ... A point I've made at a number of devsummits and elsewhere is that what we really need now is more people to "take ownership" of the performance of workloads they care about. ...
    (freebsd-arch)
  • Re: Progress on scaling of FreeBSD on 8 CPU systems
    ... year or more several of us have been working hard on profiling FreeBSD ... We have recently made significant progress on optimizing for MySQL ... contention in MySQL workloads in the past (including a UNIX domain ...
    (freebsd-performance)
  • Re: Feedback for performance tracker
    ... The four-times increase in MySQL select ... Here are some workloads I'd really like to see people take responsibility for: ... Flat file Apache performance, perhaps with Apachebench or another HTTP ... but optimizing build performance still has a big benefit for developers. ...
    (freebsd-current)