// you’re reading...

Mac OS X

How to install Sysbench on OS X

Before I start this post, I want to thank Alexey Kopytov for his assistance. Alexey, you’re a cool guy.

Also, for reference sake, I’m running Mac OS X 10.6.4 and installed mysql-5.5.6-rc-osx10.6-x86.dmg

Sysbench is a tool for MySQL DBAs to performance test or burn-in installations. I like to use it as a sanity check for new boxes. Installing Sysbench on Linux is easy and straight forward. Installation on Mac OS X is a little different. Since I searched and could not find, I thought I’d re-post the workflow for my DBA brothers and sisters running Mac workstations.

If you install MySQL using the .dmg image for OS X, your include paths may not be global and are probably under: /usr/local/mysql/ – Make sure to compare your real paths against the values below for accuracy.

First, obtain and unpack Sysbench:

wget http://garr.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.12.tar.gz
tar -xzvf sysbench-0.4.12.tar.gz
cd sysbench-0.4.12

Recreate your auto-generated files:

glibtoolize --force --copy

Next, get MySQL libs and includes into your path:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib

Next configure, make and install:

./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
make install
make clean

Finally, you’re ready to use Sysbench. Give it a test:

#Sanity test
sysbench --test=cpu
# Get table installed, insert data
sysbench \
--mysql-user=username \
--mysql-password=password \
--mysql-host=hostname \
--test=oltp \
--oltp-test-mode=complex \
# Run Test
sysbench \
--mysql-user=username \
--mysql-password=password \
--mysql-host=hostname \
--test=oltp \
--oltp-test-mode=complex \
--max-requests=1 \
# Clean up
sysbench \
--mysql-user=username \
--mysql-password=password \
--mysql-host=hostname \
--test=oltp \
--oltp-test-mode=complex \

Follow this link for options:


One comment for “How to install Sysbench on OS X”

  1. For me, the MySQL server/client is 64bit.

    I have to modify “configure” to add the -m64 to compile sysbench as 64bit.

    otherwise, I got the following error:

    gcc -D_THREAD_SAFE -g -O2 -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/usr/local/mysql/lib -lmysqlclient_r -lm
    ld: warning in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
    Undefined symbols:
    “_mysql_store_result”, referenced from:
    _mysql_drv_describe in libsbmysql.a(libsbmysql_a-drv_mysql.o)
    _mysql_drv_store_results in libsbmysql.a(libsbmysql_a-drv_mysql.o)

    gli-mn:sysbench-0.4.12 root# file /usr/local/mysql/lib/libmysqlclient_r.dylib
    /usr/local/mysql/lib/libmysqlclient_r.dylib: Mach-O 64-bit dynamically linked shared library x86_64
    gli-mn:sysbench-0.4.12 root#

    Posted by George Li | March 30, 2011, 4:47 pm

Post a comment

Help support my site and buy a domain name at http://domainsemailhosting.com/

%d bloggers like this: