yum -y install texinfo gd gnuplot gd-devel.x86_64 wget http://httperf.googlecode.com/files/httperf-0.9.0.tar.gz wget http://www.xenoclast.org/autobench/downloads/autobench-2.1.2.tar.gz tar -zxvf httperf-0.9.0.tar.gz tar -zxvf autobench-2.1.2.tar.gz cd httperf-0.9.0 && ./configure && make && make install cd autobench-2.1.2 && ./configure && make && make install cp /usr/local/bin/bench2graph /usr/local/bin/bench2png sed -i 's/postscript color/png xffffff/g' /usr/local/bin/bench2png /usr/local/bin/autobench \ --single_host \ --host1=192.168.0.2 \ --port1=80 \ --quiet \ --low_rate=10 \ --high_rate=100 \ --rate_step=10 \ --num_call=1 \ --num_conn=100 \ --timeout=10 \ --file /tmp/result.tsv 把tsv文件用图形表示出来: /usr/local/bin/bench2png /tmp/result.tsv /tmp/result.png [ 1 2 3 .... ]
sysbench --test=cpu --cpu-max-prime=20000 run #cpu测试20000以内的素数
sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run #线程测试
#硬盘性能测试 sysbench --test=fileio --num-threads=8 --file-total-size=4G --file-test-mode=rndrw prepare sysbench --test=fileio --num-threads=8 --file-total-size=4G --file-test-mode=rndrw run sysbench --test=fileio --num-threads=8 --file-total-size=4G --file-test-mode=rndrw cleanup
sysbench --test=memory --memory-block-size=16k --memory-total-size=2G run
msyql测试
sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000 \ --mysql-socket=/var/lib/mysql/mysql.sock --mysql-user=root --mysql-db=test \ --mysql-host=localhost --db-driver=mysql prepare #在test库中创建测试table添加1000000条记录
提示错误:sysbench 0.4.10: multi-threaded system evaluation benchmark FATAL: no database driver specified FATAL: failed to initialize database driver!
则是sysbench没有指定对应的数据库driver,在上面的命令后加参数 –db-driver=mysql即可