If you want to test server performance, you can think about SysBench. SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all.
Current features allow to test the following system parameters:
* file I/O performance
* scheduler performance
* memory allocation and transfer speed
* POSIX threads implementation performance
* database server performance (OLTP benchmark)
(Primarily written for MySQL server benchmarking, SysBench will be further extended to support multiple database backends, distributed benchmarks and third-party plug-in modules)
I couldn’t find CentOS RPM so here are few tips how to install it manually.
Download Sysbench (current version is 0.4.12)
# wget http://garr.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.12.tar.gz
Then unpack it and install with
# tar -xvzf sysbench-0.4.12.tar.gz # cd sysbench-0.4.12 # libtoolize --force --copy # ./autogen.sh # ./configure # make # make install
To test CPU performance you can try
# sysbench --test=cpu --cpu-max-prime=20000 run
For MySQL test, you’ll need to prepare database for testing with
# sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=500000 --mysql-user=test_database --mysql-password=test_database_password --mysql-socket=/var/lib/mysql/mysql.sock prepare
(replace test_database with valid username and test_database_password with valid password)
This command will create sample table inside test_database and it will have 500 000 rows (InnoDB engine).
sysbench 0.4.12: multi-threaded system evaluation benchmark No DB drivers specified, using mysql Creating table 'test-database'... Creating 500000 records in table 'test-database'...
Now to start read test
# sysbench --num-threads=16 --max-requests=100000 --test=oltp --oltp-table-size=500000 --mysql-socket=/var/lib/mysql/mysql.sock --oltp-read-only --mysql-user=test_database --mysql-password=test_database_password run
For read-write test you can try
# sysbench --num-threads=16 --max-requests=10000 --test=oltp --oltp-table-size=500000 --mysql-socket=/var/lib/mysql/mysql.sock --oltp-test-mode=complex --mysql-user=test_database --mysql-password=test_database_password run
More info about specific parameters can be found in official docs (http://sysbench.sourceforge.net/docs/)

I did a yum install mysql.
at the make step, I”m getting
make[3]: Entering directory `/root/sysbench-0.4.12/sysbench/drivers/mysql’
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbmysql_a-drv_mysql.o -MD -MP -MF “.deps/libsbmysql_a-drv_mysql.Tpo” -c -o libsbmysql_a-drv_mysql.o `test -f ‘drv_mysql.c’ || echo ‘./’`drv_mysql.c; \
then mv -f “.deps/libsbmysql_a-drv_mysql.Tpo” “.deps/libsbmysql_a-drv_mysql.Po”; else rm -f “.deps/libsbmysql_a-drv_mysql.Tpo”; exit 1; fi
drv_mysql.c:35:19: error: mysql.h: No such file or directory
what’s wrong?
Thanks,
Dave
You probably don’t have mysql-devel installed.
Best regards
I found the problem, I needed to yum install mysql-devel
I get following error, what can I do?
Thank you!
gcc -pthread -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/lib/mysql/ -lmysqlclient_r -lrt -lm
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_close_free_options’:
(.text+0xd8d): undefined reference to `SSL_CTX_free’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_get_ssl_cipher’:
(.text+0×1091): undefined reference to `SSL_get_current_cipher’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_real_connect’:
(.text+0x38f5): undefined reference to `SSL_get_peer_certificate’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_real_connect’:
(.text+0×3909): undefined reference to `X509_get_subject_name’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_real_connect’:
(.text+0x391d): undefined reference to `X509_NAME_oneline’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_real_connect’:
(.text+0×3925): undefined reference to `X509_free’
/usr/lib/mysql//libmysqlclient_r.a(client.o): In function `mysql_get_ssl_cipher’:
(.text+0x109a): undefined reference to `SSL_CIPHER_get_name’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `report_errors’:
(.text+0×45): undefined reference to `ERR_get_error_line_data’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0x8c): undefined reference to `SSL_new’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0x9a): undefined reference to `SSL_clear’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0xa2): undefined reference to `SSL_get_session’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0xae): undefined reference to `SSL_SESSION_set_timeout’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0xbc): undefined reference to `SSL_set_fd’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0xd1): undefined reference to `SSL_get_fd’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `ssl_do’:
(.text+0x14b): undefined reference to `SSL_free’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `sslconnect’:
(.text+0x16f): undefined reference to `SSL_connect’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `sslaccept’:
(.text+0x18f): undefined reference to `SSL_accept’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `vio_ssl_close’:
(.text+0x1c5): undefined reference to `SSL_set_quiet_shutdown’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `vio_ssl_close’:
(.text+0x1cd): undefined reference to `SSL_shutdown’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `vio_ssl_delete’:
(.text+0×212): undefined reference to `SSL_free’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `vio_ssl_write’:
(.text+0×261): undefined reference to `SSL_write’
/usr/lib/mysql//libmysqlclient_r.a(viossl.o): In function `vio_ssl_read’:
(.text+0×281): undefined reference to `SSL_read’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `report_errors’:
(.text+0×25): undefined reference to `ERR_get_error_line_data’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×99): undefined reference to `SSL_CTX_new’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xbc): undefined reference to `SSL_CTX_set_cipher_list’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xd9): undefined reference to `SSL_CTX_load_verify_locations’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0xfb): undefined reference to `SSL_CTX_use_certificate_file’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×125): undefined reference to `SSL_CTX_use_PrivateKey_file’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×135): undefined reference to `SSL_CTX_check_private_key’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×142): undefined reference to `DH_new’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×166): undefined reference to `BN_bin2bn’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×185): undefined reference to `BN_bin2bn’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1bb): undefined reference to `SSL_CTX_ctrl’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1c3): undefined reference to `DH_free’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1da): undefined reference to `SSL_load_error_strings’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1eb): undefined reference to `SSL_library_init’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x1f0): undefined reference to `OPENSSL_add_all_algorithms_noconf’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0×206): undefined reference to `SSL_CTX_set_default_verify_paths’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x21d): undefined reference to `SSL_CTX_free’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x2bd): undefined reference to `DH_free’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLFd’:
(.text+0x2d6): undefined reference to `SSL_CTX_free’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0×328): undefined reference to `TLSv1_server_method’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x36f): undefined reference to `SSL_CTX_ctrl’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0×389): undefined reference to `SSL_CTX_set_verify’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLAcceptorFd’:
(.text+0x39f): undefined reference to `SSL_CTX_set_session_id_context’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLConnectorFd’:
(.text+0x3c6): undefined reference to `TLSv1_client_method’
/usr/lib/mysql//libmysqlclient_r.a(viosslfactories.o): In function `new_VioSSLConnectorFd’:
(.text+0×405): undefined reference to `SSL_CTX_set_verify’
/usr/lib/mysql//libmysqlclient_r.a(my_compress.o): In function `my_uncompress’:
(.text+0×60): undefined reference to `uncompress’
/usr/lib/mysql//libmysqlclient_r.a(my_compress.o): In function `my_compress_alloc’:
(.text+0×102): undefined reference to `compress’
collect2: ld returned 1 exit status
make[2]: *** [sysbench] Error 1
make[2]: Leaving directory `/home/mac/sysbench-0.4.12/sysbench’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mac/sysbench-0.4.12/sysbench’
make: *** [all-recursive] Error 1
HI… Do you have openssl and openssl-devel installed ?
hi,i have a question
could you help me.
Making all in doc
make[1]: Entering directory `/opt/sysbench-0.4.12/doc’
Making all in xsl
make[2]: Entering directory `/opt/sysbench-0.4.12/doc/xsl’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/opt/sysbench-0.4.12/doc/xsl’
make[2]: Entering directory `/opt/sysbench-0.4.12/doc’
make[2]: Nothing to be done for `all-am’.
make[2]: Leaving directory `/opt/sysbench-0.4.12/doc’
make[1]: Leaving directory `/opt/sysbench-0.4.12/doc’
Making all in sysbench
make[1]: Entering directory `/opt/sysbench-0.4.12/sysbench’
Making all in drivers
make[2]: Entering directory `/opt/sysbench-0.4.12/sysbench/drivers’
Making all in mysql
make[3]: Entering directory `/opt/sysbench-0.4.12/sysbench/drivers/mysql’
gcc -DHAVE_CONFIG_H -I. -I../../../config -I/usr/local/mysql/include/ -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbmysql_a-drv_mysql.o -MD -MP -MF .deps/libsbmysql_a-drv_mysql.Tpo -c -o libsbmysql_a-drv_mysql.o `test -f ‘drv_mysql.c’ || echo ‘./’`drv_mysql.c
drv_mysql.c:35:19: error: mysql.h: No such file or directory
drv_mysql.c:36:26: error: mysqld_error.h: No such file or directory
drv_mysql.c: In function ‘mysql_drv_describe’:
drv_mysql.c:284: error: ‘MYSQL_RES’ undeclared (first use in this function)
drv_mysql.c:284: error: (Each undeclared identifier is reported only once
drv_mysql.c:284: error: for each function it appears in.)
drv_mysql.c:284: error: ‘res’ undeclared (first use in this function)
drv_mysql.c:285: error: ‘MYSQL_ROW’ undeclared (first use in this function)
drv_mysql.c:285: error: expected ‘;’ before ‘row’
drv_mysql.c:286: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
drv_mysql.c:286: error: ‘fields’ undeclared (first use in this function)
drv_mysql.c:328: error: ‘row’ undeclared (first use in this function)
drv_mysql.c: In function ‘mysql_drv_connect’:
drv_mysql.c:360: error: ‘MYSQL’ undeclared (first use in this function)
drv_mysql.c:360: error: ‘con’ undeclared (first use in this function)
drv_mysql.c:366: error: expected expression before ‘)’ token
drv_mysql.c:401: error: ‘MYSQL_VERSION_ID’ undeclared (first use in this function)
drv_mysql.c: In function ‘mysql_drv_disconnect’:
drv_mysql.c:441: error: ‘MYSQL’ undeclared (first use in this function)
drv_mysql.c:441: error: ‘con’ undeclared (first use in this function)
drv_mysql.c: In function ‘mysql_drv_bind_param’:
drv_mysql.c:520: error: ‘MYSQL’ undeclared (first use in this function)
drv_mysql.c:520: error: ‘con’ undeclared (first use in this function)
drv_mysql.c:520: error: expected expression before ‘)’ token
drv_mysql.c: In function ‘mysql_drv_query’:
drv_mysql.c:729: error: ‘MYSQL’ undeclared (first use in this function)
drv_mysql.c:729: error: ‘con’ undeclared (first use in this function)
drv_mysql.c:739: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
drv_mysql.c:739: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
drv_mysql.c:739: error: ‘ER_CHECKREAD’ undeclared (first use in this function)
drv_mysql.c: In function ‘mysql_drv_store_results’:
drv_mysql.c:789: error: ‘MYSQL’ undeclared (first use in this function)
drv_mysql.c:789: error: ‘con’ undeclared (first use in this function)
drv_mysql.c:790: error: ‘MYSQL_RES’ undeclared (first use in this function)
drv_mysql.c:790: error: ‘res’ undeclared (first use in this function)
drv_mysql.c:791: error: ‘MYSQL_ROW’ undeclared (first use in this function)
drv_mysql.c:791: error: expected ‘;’ before ‘row’
drv_mysql.c:839: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
drv_mysql.c:839: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
drv_mysql.c:855: error: ‘row’ undeclared (first use in this function)
drv_mysql.c: In function ‘mysql_drv_free_results’:
drv_mysql.c:879: error: ‘MYSQL_RES’ undeclared (first use in this function)
drv_mysql.c:879: error: expected expression before ‘)’ token
make[3]: *** [libsbmysql_a-drv_mysql.o] Error 1
make[3]: Leaving directory `/opt/sysbench-0.4.12/sysbench/drivers/mysql’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/sysbench-0.4.12/sysbench/drivers’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/sysbench-0.4.12/sysbench’
make: *** [all-recursive] Error 1
As you can see:
drv_mysql.c:35:19: error: mysql.h: No such file or directory
So, something is wrong with your mysql installation.
Try
“yum install mysql-devel” or appropriate command depending from your distro.
id do “yum install mysql-devel”
Still error
Installing mysqlclient15-5.0.67-1.el5.remi.x86_64.rpm provided the needed library