首页 > Web服务器 > Httperf+AutoBech+GnuPlot构建WEBSERVER压力测试系统

Httperf+AutoBech+GnuPlot构建WEBSERVER压力测试系统

2012年6月6日 发表评论 阅读评论

一、资源
Htterf: http://code.google.com/p/httperf/
AutoBech: http://www.xenoclast.org/autobench/
GnuPlot: http://www.gnuplot.info/

二、安装 Httperf & Httperf
1. Httperf

./configure –prefix=/usr/local/httperf

make && make install

export PATH=”$PATH:/usr/local/httperf/bin”
2. AutoBech

make && make install
三、安装 GnuPlot
1. 检查所需的 RPM 包

png-devel, libjpeg-devel, libtiff-devel, freetype-devel
2. 安装 GD

./configure –prefix=/usr/local/gd2
3. 安装 GnuPlot

./configure \
“–prefix=/usr/local/gnuplot” \
“–with-cwdrc” \
“–without-row-help” \
“–with-kpsexpand” \
“–with-gd=/usr/local/gd2″ \

make && make install

ln -s /usr/local/gd2/lib/libgd.so.2.0.0 /usr/lib/libgd.so.2
四、测试
1. Httperf

httperf \
–hog \
–server=home.inanu.net \
–uri=/mysql.php \
–wsess=100,1000,3 \
–burst-length=10 \
–rate=5 \
–timeout=5
如果得出有效测试结果则继续。

2. AutoBech
Singe Host
========

./autobench \
–single_host \
–host1=home.inanu.net \
–port1=80 \
–uri1=/mysql.php
–quiet \
–low_rate=10 \
–high_rate=100 \
–rate_step=5 \
–num_call 15 \
–num_conn 5000 \
–timeout=10 \
–file /opt/Result.tsv
Double Host
=========

./autobench \
–host1=home.inanu.net \
–port1=80 \
–uri1=/mysql.php \
–host2=h.inanu.net \
–port2=80 \
–uri2=/mysql_p.php \
–quiet \
–low_rate=5 \
–high_rate=100 \
–rate_step=5 \
–num_call=5 \
–num_conn=1000 \
–timeout=10 \
–file /opt/Result.tsv
3. 生成 PNG 测试图像
(1) 修改 bench2graph

cp /usr/local/bin/bench2graph /usr/local/bin/bench2png
vi /usr/local/bin/bench2png
找到:echo set terminal postscript color > gnuplot.cmd
改为:echo set terminal png large size 640,480 truecolor > gnuplot.cmd

找到:set data style
改为:set style data
(2) 生成图像

/usr/local/bin/bench2png /opt/Result.tsv /opt/Result.png [1 2 3 ... n]
( 1 2 3 … n: 表示 Results.tsv 结果集文件中的项目 )

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.