当前位置: > CentOS > CentOS教程 >

CentOS下安装 Tsung-压力测试工具

时间:2015-09-02 08:39来源:linux.it.net.cn 作者:IT
官网地址:http://tsung.erlang-projects.org/

Tsung压力测试工具的工作原理介绍

(1)  Tsung的每一个虚拟用户就是一个erlang的轻量进程。这点和loadrunner有大区别。
(2)  虚拟用户完成session后就消失。
(3)  大量的虚拟用户(erlang轻量进程)建立在erlangVM上。
CentOS下安装步骤:
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查看
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容