基准测试工具可以用来对数据库或者操作系统调优后的性能进行对比;mysql数据库本身提供了很多比较优秀的工具;比如:sysbench,mysql-tpcc;
在配置sysbench的时候,比较简单;直接下载包,然后安装即可(http://sourceforge.net/projects/sysbench/)
我现在的是这个版本;
[root@slave01 local]# ls
bin games lib mysql-5.5.13.tar.gz sysbench-0.4.12
cmake-2.8.5 include libexec percona-xtrabackup-2.0.4.tar.gz sysbench-0.4.12.tar.gz
cmake-2.8.5.tar.gz keepalived man sbin xtrabackup
doc keepalived-1.2.7 mysql share
etc keepalived-1.2.7.tar.gz mysql-5.5.13 src
[root@slave01 local]#
然后tar -zxvf 解压文件;
进入文件后,执行配置文件检查如下(一定要注意安装路径的选择,否则会报错);
./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
然后做make && make install;
[root@slave01 sysbench-0.4.12]# make
Making all in doc
make[1]: Entering directory `/usr/local/sysbench-0.4.12/doc'
Making all in xsl
make[2]: Entering directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[2]: Entering directory `/usr/local/sysbench-0.4.12/doc'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/doc'
make[1]: Leaving directory `/usr/local/sysbench-0.4.12/doc'
Making all in sysbench
make[1]: Entering directory `/usr/local/sysbench-0.4.12/sysbench'
Making all in drivers
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
Making all in mysql
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
if gcc -DHAVE_CONFIG_H -I. -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; \
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
rm -f libsbmysql.a
ar cru libsbmysql.a libsbmysql_a-drv_mysql.o
ranlib libsbmysql.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
Making all in tests
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests'
Making all in cpu
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbcpu_a-sb_cpu.o -MD -MP -MF ".deps/libsbcpu_a-sb_cpu.Tpo" -c -o libsbcpu_a-sb_cpu.o `test -f 'sb_cpu.c' || echo './'`sb_cpu.c; \
then mv -f ".deps/libsbcpu_a-sb_cpu.Tpo" ".deps/libsbcpu_a-sb_cpu.Po"; else rm -f ".deps/libsbcpu_a-sb_cpu.Tpo"; exit 1; fi
rm -f libsbcpu.a
ar cru libsbcpu.a libsbcpu_a-sb_cpu.o
ranlib libsbcpu.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
Making all in fileio
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbfileio_a-sb_fileio.o -MD -MP -MF ".deps/libsbfileio_a-sb_fileio.Tpo" -c -o libsbfileio_a-sb_fileio.o `test -f 'sb_fileio.c' || echo './'`sb_fileio.c; \
then mv -f ".deps/libsbfileio_a-sb_fileio.Tpo" ".deps/libsbfileio_a-sb_fileio.Po"; else rm -f ".deps/libsbfileio_a-sb_fileio.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbfileio_a-crc32.o -MD -MP -MF ".deps/libsbfileio_a-crc32.Tpo" -c -o libsbfileio_a-crc32.o `test -f 'crc32.c' || echo './'`crc32.c; \
then mv -f ".deps/libsbfileio_a-crc32.Tpo" ".deps/libsbfileio_a-crc32.Po"; else rm -f ".deps/libsbfileio_a-crc32.Tpo"; exit 1; fi
rm -f libsbfileio.a
ar cru libsbfileio.a libsbfileio_a-sb_fileio.o libsbfileio_a-crc32.o
ranlib libsbfileio.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
Making all in memory
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbmemory_a-sb_memory.o -MD -MP -MF ".deps/libsbmemory_a-sb_memory.Tpo" -c -o libsbmemory_a-sb_memory.o `test -f 'sb_memory.c' || echo './'`sb_memory.c; \
then mv -f ".deps/libsbmemory_a-sb_memory.Tpo" ".deps/libsbmemory_a-sb_memory.Po"; else rm -f ".deps/libsbmemory_a-sb_memory.Tpo"; exit 1; fi
rm -f libsbmemory.a
ar cru libsbmemory.a libsbmemory_a-sb_memory.o
ranlib libsbmemory.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
Making all in threads
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbthreads_a-sb_threads.o -MD -MP -MF ".deps/libsbthreads_a-sb_threads.Tpo" -c -o libsbthreads_a-sb_threads.o `test -f 'sb_threads.c' || echo './'`sb_threads.c; \
then mv -f ".deps/libsbthreads_a-sb_threads.Tpo" ".deps/libsbthreads_a-sb_threads.Po"; else rm -f ".deps/libsbthreads_a-sb_threads.Tpo"; exit 1; fi
rm -f libsbthreads.a
ar cru libsbthreads.a libsbthreads_a-sb_threads.o
ranlib libsbthreads.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
Making all in mutex
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -pthread -g -O2 -MT libsbmutex_a-sb_mutex.o -MD -MP -MF ".deps/libsbmutex_a-sb_mutex.Tpo" -c -o libsbmutex_a-sb_mutex.o `test -f 'sb_mutex.c' || echo './'`sb_mutex.c; \
then mv -f ".deps/libsbmutex_a-sb_mutex.Tpo" ".deps/libsbmutex_a-sb_mutex.Po"; else rm -f ".deps/libsbmutex_a-sb_mutex.Tpo"; exit 1; fi
rm -f libsbmutex.a
ar cru libsbmutex.a libsbmutex_a-sb_mutex.o
ranlib libsbmutex.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
Making all in oltp
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -I./.. -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../../../sysbench -I/usr/local/mysql/include -pthread -g -O2 -MT libsboltp_a-sb_oltp.o -MD -MP -MF ".deps/libsboltp_a-sb_oltp.Tpo" -c -o libsboltp_a-sb_oltp.o `test -f 'sb_oltp.c' || echo './'`sb_oltp.c; \
then mv -f ".deps/libsboltp_a-sb_oltp.Tpo" ".deps/libsboltp_a-sb_oltp.Po"; else rm -f ".deps/libsboltp_a-sb_oltp.Tpo"; exit 1; fi
rm -f libsboltp.a
ar cru libsboltp.a libsboltp_a-sb_oltp.o
ranlib libsboltp.a
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests'
Making all in .
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench'
if gcc -DHAVE_CONFIG_H -I. -I. -I../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../sysbench -pthread -g -O2 -MT sysbench.o -MD -MP -MF ".deps/sysbench.Tpo" -c -o sysbench.o sysbench.c; \
then mv -f ".deps/sysbench.Tpo" ".deps/sysbench.Po"; else rm -f ".deps/sysbench.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../sysbench -pthread -g -O2 -MT sb_timer.o -MD -MP -MF ".deps/sb_timer.Tpo" -c -o sb_timer.o sb_timer.c; \
then mv -f ".deps/sb_timer.Tpo" ".deps/sb_timer.Po"; else rm -f ".deps/sb_timer.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../sysbench -pthread -g -O2 -MT sb_options.o -MD -MP -MF ".deps/sb_options.Tpo" -c -o sb_options.o sb_options.c; \
then mv -f ".deps/sb_options.Tpo" ".deps/sb_options.Po"; else rm -f ".deps/sb_options.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../sysbench -pthread -g -O2 -MT sb_logger.o -MD -MP -MF ".deps/sb_logger.Tpo" -c -o sb_logger.o sb_logger.c; \
then mv -f ".deps/sb_logger.Tpo" ".deps/sb_logger.Po"; else rm -f ".deps/sb_logger.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../config -D_REENTRANT -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I../sysbench -pthread -g -O2 -MT db_driver.o -MD -MP -MF ".deps/db_driver.Tpo" -c -o db_driver.o db_driver.c; \
then mv -f ".deps/db_driver.Tpo" ".deps/db_driver.Po"; else rm -f ".deps/db_driver.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link 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/local/mysql/lib -lmysqlclient_r -lrt -laio -lm
mkdir .libs
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/local/mysql/lib -lmysqlclient_r -lrt -laio -lm
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench'
make[1]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench'
make[1]: Entering directory `/usr/local/sysbench-0.4.12'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/local/sysbench-0.4.12'
[root@slave01 sysbench-0.4.12]# make install
Making install in doc
make[1]: Entering directory `/usr/local/sysbench-0.4.12/doc'
Making install in xsl
make[2]: Entering directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/doc/xsl'
make[2]: Entering directory `/usr/local/sysbench-0.4.12/doc'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/doc'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/doc/sysbench" || mkdir -p -- "/usr/local/share/doc/sysbench"
/usr/bin/install -c -m 644 'manual.html' '/usr/local/share/doc/sysbench/manual.html'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/doc'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/doc'
make[1]: Leaving directory `/usr/local/sysbench-0.4.12/doc'
Making install in sysbench
make[1]: Entering directory `/usr/local/sysbench-0.4.12/sysbench'
Making install in drivers
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
Making install in mysql
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers/mysql'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/drivers'
Making install in tests
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests'
Making install in cpu
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/cpu'
Making install in fileio
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/fileio'
Making install in memory
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/memory'
Making install in threads
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/threads'
Making install in mutex
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/mutex'
Making install in oltp
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests/oltp'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[4]: Entering directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench/tests'
Making install in .
make[2]: Entering directory `/usr/local/sysbench-0.4.12/sysbench'
make[3]: Entering directory `/usr/local/sysbench-0.4.12/sysbench'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
/bin/sh ../libtool --mode=install /usr/bin/install -c 'sysbench' '/usr/local/bin/sysbench'
/usr/bin/install -c sysbench /usr/local/bin/sysbench
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench'
make[2]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench'
make[1]: Leaving directory `/usr/local/sysbench-0.4.12/sysbench'
make[1]: Entering directory `/usr/local/sysbench-0.4.12'
make[2]: Entering directory `/usr/local/sysbench-0.4.12'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/local/sysbench-0.4.12'
make[1]: Leaving directory `/usr/local/sysbench-0.4.12'
[root@slave01 sysbench-0.4.12]# find / -name libmysqlclient.so*
/usr/local/mysql-5.5.13/libmysql/libmysqlclient.so.18.0.0
/usr/local/mysql-5.5.13/libmysql/libmysqlclient.so
/usr/local/mysql-5.5.13/libmysql/libmysqlclient.so.18
/usr/local/mysql/lib/libmysqlclient.so.18.0.0
/usr/local/mysql/lib/libmysqlclient.so
/usr/local/mysql/lib/libmysqlclient.so.18
/usr/lib/mysql/libmysqlclient.so.15
/usr/lib/mysql/libmysqlclient.so.15.0.0
[root@slave01 sysbench-0.4.12]#
然后把相关的环境变量的路径规制好;
export LD_LIBRARY_PATH=/usr/local/mysql/lib
其后做测试;如(内存测试);
[root@slave01 ~]#sysbench --test=memory --memory-block-size=8k --memory-total-size=4G run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing memory operations speed test
Memory block size: 0K
Memory transfer size: 0M
Memory operations type: write
Memory scope type: global
Threads started!
Done.
Operations performed: 0 ( 0.00 ops/sec)
0.00 MB transferred (0.00 MB/sec)
Test execution summary:
total time: 0.0004s
total number of events: 0
total time taken by event execution: 0.0000
per-request statistics:
min: 18446744073709.55ms
avg: 0.00ms
max: 0.00ms
Threads fairness:
events (avg/stddev): 0.0000/0.00
execution time (avg/stddev): 0.0000/0.00
[root@slave01 ~]#
(1)内存测试;
[root@slave01 ~]#sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 24576Kb each, 3072Mb total
Creating files for the test...
[root@slave01 ~]# sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Extra file open flags: 0
128 files, 24Mb each
3Gb total file size
Block size 16Kb
Number of random requests for random IO: 10000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Threads started!
Done.
Operations performed: 6006 Read, 3994 Write, 12800 Other = 22800 Total
Read 93.844Mb Written 62.406Mb Total transferred 156.25Mb (16.966Mb/sec)
1085.85 Requests/sec executed
Test execution summary:
total time: 9.2094s
total number of events: 10000
total time taken by event execution: 110.8009
per-request statistics:
min: 0.01ms
avg: 11.08ms
max: 1192.86ms
approx. 95 percentile: 57.50ms
Threads fairness:
events (avg/stddev): 625.0000/85.24
execution time (avg/stddev): 6.9251/0.42
[root@slave01 ~]#
[root@slave01 ~]#sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw cleanup
sysbench 0.4.12: multi-threaded system evaluation benchmark
Removing test files...
[root@slave01 ~]#
(二)CPU性能测试;
[root@slave01 ~]# sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 20000
Test execution summary:
total time: 33.9551s
total number of events: 10000
total time taken by event execution: 33.9494
per-request statistics:
min: 3.20ms
avg: 3.39ms
max: 7.59ms
approx. 95 percentile: 3.56ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 33.9494/0.00
[root@slave01 ~]#
同时也可以测试OLTP性能的测试,这里略去!