2014년 1월 20일 월요일

SysBench on CentOS – HowTo

SysBench on CentOS – HowTo

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/)

댓글 없음:

댓글 쓰기