Install and use bitsCN.com for sysbench
Install and use sysbench
Sysbench is an open-source multi-threaded performance testing tool that can perform performance tests on CPU, memory, thread, IO, and database. The database currently supports MySQL, Oracle, and PostgreSQL.
Installation process (rhel5.8 + mysql5.5)
Errors are reported constantly during the installation process. it takes only one morning for reference to a large number of online materials.
1. prepare the environment, install related software packages, mount the optical drive, and configure yum
Mount-o loop/data/rhel-server-5.9-x86_64-dvd.iso/mnt/cdrom
Configure yum
Vi/etc/yum. repos. d/rhel58.repo
[Server]
Name = rhel58server
Baseurl = file: // mnt/cdrom/Server/
Enable = 1
Gpcheck = 1
Gpgkey = file: // mnt/cdrom/Server/RPM-GPG-KEY-redhat-release
2. install the related software package. Otherwise, an error may occur (note that you must install mysql-devel)
Yum install automake
Yum install libtool
Yum install zlib
Yum install gcc
Yum install gcc glibc-devel glibc-headers glibc-kernheaders
3. formal installation
A. extract
Tar zxvf sysbench-0.4.8.tar.gz
B. modify the configuration file.
Vi configure. ac
# Checks for programs.
AC_PROG_CC
# AC_PROG_LIBTOOL
AC_PROG_RANLIB
AX_CHECK_DOCBOOK
C. execute the following commands respectively,
./Autogen. sh
./Configure -- with-mysql-supported des =/usr/include/mysql/
-- With-mysql-libs =/usr/lib64/mysql/
LDFLAGS = '-ldld'
Make
Makeinstall
Problems during installation
1. copy config. guess and config. sub from/usr/share/libtool to current directory, then./configure
2. Error: client_plugin.c: 178: undefined reference to 'dlclose' sysbench
./Config command to add the LDFLAGS = '-ldld' parameter
Test method
1. cpu performance test
Sysbench -- test = cpu -- cpu-max-prime = 20000 run
In the preceding example, the maximum prime number is 20000. you can adjust the value based on the cpu performance.
2. Thread Testing
Sysbench -- test = threads -- num-threads = 64 -- thread-yields = 100 -- thread-locks = 2 run
3. disk I/O performance test
Sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file-test-mode = rndrw prepare
Sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file-test-mode = rndrw run
Sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file-test-mode = rndrw cleanup
The above parameters specify a maximum of 16 threads, the total size of the created files is 3 GB, and the file read/write mode is random read.
4. memory test
Sysbench -- test = memory -- memory-block-size = 8 k -- memory-total-size = 4G run
The above parameter specifies that the entire test process is to transfer 4 GB of data in the memory, each block size is 8 K.
5. OLTP test
Sysbench -- test = oltp -- mysql-table-engine = innodb -- mysql-user = root -- db-driver = mysql -- mysql-db = sbtest -- oltp-table-size = 30000000 -- oltp-table-name = t2 -- oltp-nontrx-mode = insert -- mysql-socket =/var/lib/mysql. sock prepare
Sysbench -- test = oltp -- mysql-table-engine = innodb -- mysql-user = root -- db-driver = mysql -- mysql-db = sbtest -- oltp-table-size = 30000000 -- oltp-table-name = t1 -- mysql-socket =/var/lib/mysql. sock run
BitsCN.com