Progress on scaling of FreeBSD on 8 CPU systems

[ Available lists | Index of freebsd-current | Month of Feb 2007 | Week of 24 Feb 2007 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Kris Kennaway <kris@obsecurity.org>
Date
24 Feb 2007 21:31:13
Subject
Progress on scaling of FreeBSD on 8 CPU systems
Message-ID
20070224213111.GB41434@xor.obsecurity.org

Referenced by
Matt Olander, Matt Olander (freebsd-hackers) , Matt Olander (freebsd-hackers) , Matt Olander (freebsd-smp) , Coleman Kane, Coleman Kane (freebsd-hackers) , Coleman Kane (freebsd-smp) , Kris Kennaway, Kris Kennaway (freebsd-smp) , Kris Kennaway (freebsd-hackers) , Kris Kennaway (freebsd-hackers) , Kris Kennaway, Kris Kennaway (freebsd-smp) , Andre Guibert de Bruet, Kris Kennaway (freebsd-smp) , Kris Kennaway (freebsd-hackers) , Kris Kennaway, Andre Guibert de Bruet (freebsd-smp) , Andre Guibert de Bruet (freebsd-hackers) , Coleman Kane (freebsd-hackers) , Coleman Kane (freebsd-smp) , Coleman Kane, Coleman Kane, Coleman Kane (freebsd-hackers) , Coleman Kane (freebsd-smp) , Ivan Voras, Robert Watson (freebsd-hackers) , Robert Watson, Robert Watson, Robert Watson (freebsd-smp) , Martin Blapp (freebsd-hackers) , Martin Blapp (freebsd-smp) , Martin Blapp, Robert Watson, Robert Watson (freebsd-smp) , Robert Watson (freebsd-hackers) , Kris Kennaway (freebsd-hackers) , Martin Blapp (freebsd-hackers) , Kris Kennaway (freebsd-hackers) , Peter Jeremy (freebsd-hackers) , Peter Jeremy, Peter Jeremy (freebsd-smp) , Kris Kennaway (freebsd-hackers) , Kris Kennaway (freebsd-smp) , Kris Kennaway, Divacky Roman, Kris Kennaway (freebsd-hackers) , Kris Kennaway, Kris Kennaway (freebsd-smp) , Divacky Roman (freebsd-smp) , Divacky Roman (freebsd-hackers) , John Baldwin, Jim C. Nasby, Jim C. Nasby (freebsd-hackers) , Jim C. Nasby (freebsd-smp) , Kris Kennaway (freebsd-hackers) , Kris Kennaway (freebsd-smp) , Kris Kennaway, Kris Kennaway (freebsd-smp) , Jim C. Nasby (freebsd-smp) , Jim C. Nasby (freebsd-hackers) , Jim C. Nasby, B. Estrade (freebsd-smp) , Sten Daniel Soersdal, Sten Daniel Soersdal (freebsd-hackers) , Sten Daniel Soersdal (freebsd-smp) , Coleman Kane (freebsd-hackers) , Coleman Kane, Coleman Kane (freebsd-smp) , Craig Boston, Craig Boston (freebsd-hackers) , Craig Boston (freebsd-smp)

[ Hide this part ]
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.

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

With this configuration we are able to achieve performance that is
consistent with Linux at peak (the graph shows Linux 2% faster, but
this is commensurate with the margin of error coming from variance
between runs, so more data is needed to distinguish them), with 8
client threads (=1 thread/CPU core), and significantly outperforms
Linux at higher than peak loads, when running on the same hardware.

Specifically, beyond 8 client threads FreeBSD has only minor
performance degradation (an 8% drop from peak throughput at 8 clients
to 20 clients), but Linux collapses immediately above 8 threads, and
above 14 threads asymptotes to essentially single-threaded levels. At
20 clients FreeBSD outperforms Linux by a factor of 4.

We see this result as part of the payoff we are seeing from the hard
work of many developers over the past 7 years. In particular it is a
significant validation of the SMP and locking strategies chosen for
the FreeBSD kernel in the post-FreeBSD 4.x world.

More configuration details and discussion about the benchmark may be
found here:

http://people.freebsd.org/~kris/scaling/mysql.html

Kris


[ Show this part (application/pgp-signature) ]

Elapsed time: 0.204 seconds