http://tsung.erlang-projects.org/
Tsung壓力測試工具的工作原理介紹
(1) Tsung的每一個虛擬用戶就是一個erlang的輕量進程。這點和loadrunner有大區別。
(2) 虛擬用戶完成session後就消失。
(3) 大量的虛擬用戶(erlang輕量進程)建立在erlangVM上。
Tsung安裝包、erlang安裝包、Perl ( 生成報告所需模塊)、圖形庫gnuplot等
1.erlang
2.perl
3.gnuplot
yum install gd libpng zlib
erlang安裝:
http://www.erlang.org/download/otp_src_R15B02.tar.gz
tar zxvf otp_src_R15B02.tar.gz
cd otp_src_R15B02
./configure
make
make install
gnuplot安裝:
wget http://nchc.dl.sourceforge.net/project/gnuplot/gnuplot/4.4.0/gnuplot-4.4.0.tar.gz
tar -zxvf gnuplot-4.4.0.tar.gz
cd gnuplot-4.4.0
./configure
make
make install
template-toolki安裝:
wget http://www.cpan.org/modules/by-module/Template/Template-Toolkit-2.24.tar.gz
tar zxf Template-Toolkit-2.24.tar.gz
cd Template-Toolkit-2.24
perl Makefile.PL
make
make install
配置Tsung:
~/.tsung/tsung.xml爲tsung默認的配置文件,但我們安裝後會發現這個目錄和文件並不存在,那就由我們手動來創建這個目錄。
mkdir /home/.tsung
在/usr/share/doc/tsung/examples/中有一些示例文件,可以參考jabber_register.xml文件來編寫自己的tsung.xml。
cp /usr/share/doc/tsung/examples/jabber_register.xml ~/.tsung/tsung.xml
啓動Tsung
tsung start/stop/debug/status
tsung -f /home/.tsung/tsung.xml start
進入日誌目錄
cd /root/.tsung/log/20120913-1436
運行腳本生成報表文件
/usr/local/lib/tsung/bin/tsung_stats.pl
查看生成的報表:
把整個20120913-1436目錄拖下來,或者裝個apache查看