Installation and usage sharing of sysbench


Installation process (rhel5.8 + mysql5.5) During the installation process, I kept reporting errors and referred to many online materials. It took me 1 morning to get it done 1. Environment preparation, installation of relevant software package, mounting of optical drive, configuration of yum mount -o loop /data/rhel-server-5.9-x86_64-dvd.iso /mnt/cdrom Configuration 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 relevant software package, or you may report an error (be careful to 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, unzipped 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 command, ./autogen.sh ./configure —with-mysql-includes=/usr/include/mysql \ —with-mysql-libs=/usr/lib64/mysql \ LDFLAGS=’-ldl’ make makeinstall

Problems associated with installation 1, copy config. guess and config. sub from /usr/share/libtool to current directory, then. /configure

2, error reporting: error reporting client_plugin. c:178: undefined reference to ‘dlclose’ dlclose’ sysbench problem The./config command adds the parameter LDFLAGS=’ -ldl ’

Specific test method

1. cpu performance test

sysbench —test=cpu —cpu-max-prime=20000 run

The cpu test is mainly used for the addition of prime Numbers. In the above example, the maximum number of prime Numbers is specified to be 20,000, and I can adjust the value appropriately according to the performance of the machine cpu.

2. Thread testing

sysbench —test=threads —num-threads=64 —thread-yields=100 —thread-locks=2 run

3. Disk IO 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 parameter specifies a maximum of 16 threads to create, a total file size of 3G, and a file read/write mode of random read.

4. Memory testing

sysbench —test=memory —memory-block-size=8k —memory-total-size=4G run

The above parameters specify how much data 4G was transferred in memory during the entire test, with each block being 8K in size.

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/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/mysql.sock run