You should rebuild malloc with MALLOC_PRODUCTION defined (edit
lib/libc/stdlib/malloc.c) as well as making sure that either
/etc/malloc.conf is removed or symlinked to 'aj'. This is pretty important.
Could you also provide a copy of your FreeBSD kernel configuration file
just so we can double-check?
OK, the only difference to my config is that I have
innodb_log_file_size=900M
instead of 100M.
OK. The FreeBSD port also defines
--enable-thread-safe-client
--without-debug
--enable-assembler
(and some other options that don't look relevant). --with-pthread might
enable the first option but if not it could cause performance
anomalies (i.e. this is relevant for the client, of course). For
example I accidentally built postgresql without threaded client support
recently and spent a while trying to work out why sysbench suddenly ran
at half speed.
I use
sysbench --test=oltp --num-threads=$1 --mysql-user=root --max-time=120
--max-requests=0 --oltp-read-only=on --db-driver=mysql
--mysql-host=192.168.5.120 run
which seems to be equivalent (the default table engine is innodb in our
config).
Can you run 'vmstat -w 1' for e.g. 30 seconds on your FreeBSD system
when the test is running? I see total CPU usage at 100%, with system at
20-25% and the rest user.
I tested on a quad 500 MHz p3 (i.e. 30% slower clock speed than your
system), via 100Mbps em0. Performance was already at the level of the
FreeBSD curve on your graph (about 320 tps across a range of loads), and
if I scale up by 700/500 then it's about the same as your NetBSD curve.
I suspect that this will actually underestimate performance a bit
because the CPU is an older generation than yours, so the difference is
not just clock speed. One thing that is kind of interesting is that
some of the locking optimizations that we have not yet committed don't
make a difference on this machine and workload, apparently they are only
important at 8 CPUs and above.
Anyway, this all suggests to me that something is going wrong on your
system, so if the above doesn't help then we'll have to look closer.
One other possibility is that your NIC may be misbehaving.
Kris