XMPP、HTTP 模拟压力测试工具 Tsung 教程
2013-06-14 14:08
239 查看
一、部署安装
==============
1)安装依赖
yum -y install perl
yum -y install gnuplot
由于需要erlang支持,那么下载erlang-R14B04
wget http://www.erlang.org/download/otp_src_R14B04.tar.gz
tar zxvf opt_src_R14B04.tar.gz
cd opt_src_R14B04
./configure –-prefix=/usr/local/erlang
make
make install
2)安装tsung
wget http://tsung.erlang-projects.org/dist/tsung-1.4.1.tar.gz
tar zxvf tsung-1.4.1.tar.gz
cd tsung-1.4.1
./configure –-prefix=/usr/local/tsung –-with-erlang=/usr/local/erlang
make
make install
----
示例xml脚本。
/usr/local/tsung/share/doc/tsung/examples
程序安装到了
/usr/local/tsung/
二、配置启动
==============
1)配置XMPP登陆示例
xmppLogin.xml
[html] view
plaincopyprint?
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<!-- Clients setup -->
<clients>
<client host="localhost" use_controller_vm="true" maxusers="60000"></client>
</clients>
<!-- Servers setup -->
<servers>
<server host="127.0.0.1" port="5222" type="tcp"></server>
</servers>
<!-- Load User -->
<load>
<arrivalphase phase="1" duration="60" unit="minute">
<users arrivalrate="50" unit="second"></users>
</arrivalphase>
</load>
<!-- Jabber parameters -->
<options>
<option type="ts_jabber" name="global_number" value="100"></option>
<option type="ts_jabber" name="userid_max" value="1000000"></option>
<option type="ts_jabber" name="domain" value="wemomo.com"></option>
<option type="ts_jabber" name="username" value="1602"></option>
<option type="ts_jabber" name="passwd" value="1602"></option>
</options>
<!-- Session TODO -->
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request><jabber type="connect" ack="no_ack"></jabber></request>
<transaction name="authenticate">
<request><jabber type="auth_sasl" ack="local"/></request>
<request><jabber type="auth_sasl_bind" ack="local"></jabber></request>
<request><jabber type="auth_sasl_session" ack="local"></jabber></request>
</transaction>
<request><jabber type="presence:initial" ack="no_ack"/></request>
<thinktime value="300000"></thinktime>
</session>
</sessions>
</tsung>
2)启动
./tsung -f xmppLogin.xml start
三、问题描述
==============
使用该脚本测试的时候,要禁用XMPP服务器的auth验证模块,不然账号密码不对,登陆不进去。
单个IP的端口65535的问题导致单个机器模拟的连接数有限,这个问题我没解决,只能通过使用很多机器都开这个服务来解决。
四、相关文档
==============
http://tsung.erlang-projects.org/ http://www.ec-os.net/misc/Tsung.html
==============
1)安装依赖
yum -y install perl
yum -y install gnuplot
由于需要erlang支持,那么下载erlang-R14B04
wget http://www.erlang.org/download/otp_src_R14B04.tar.gz
tar zxvf opt_src_R14B04.tar.gz
cd opt_src_R14B04
./configure –-prefix=/usr/local/erlang
make
make install
2)安装tsung
wget http://tsung.erlang-projects.org/dist/tsung-1.4.1.tar.gz
tar zxvf tsung-1.4.1.tar.gz
cd tsung-1.4.1
./configure –-prefix=/usr/local/tsung –-with-erlang=/usr/local/erlang
make
make install
----
示例xml脚本。
/usr/local/tsung/share/doc/tsung/examples
程序安装到了
/usr/local/tsung/
二、配置启动
==============
1)配置XMPP登陆示例
xmppLogin.xml
[html] view
plaincopyprint?
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<!-- Clients setup -->
<clients>
<client host="localhost" use_controller_vm="true" maxusers="60000"></client>
</clients>
<!-- Servers setup -->
<servers>
<server host="127.0.0.1" port="5222" type="tcp"></server>
</servers>
<!-- Load User -->
<load>
<arrivalphase phase="1" duration="60" unit="minute">
<users arrivalrate="50" unit="second"></users>
</arrivalphase>
</load>
<!-- Jabber parameters -->
<options>
<option type="ts_jabber" name="global_number" value="100"></option>
<option type="ts_jabber" name="userid_max" value="1000000"></option>
<option type="ts_jabber" name="domain" value="wemomo.com"></option>
<option type="ts_jabber" name="username" value="1602"></option>
<option type="ts_jabber" name="passwd" value="1602"></option>
</options>
<!-- Session TODO -->
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request><jabber type="connect" ack="no_ack"></jabber></request>
<transaction name="authenticate">
<request><jabber type="auth_sasl" ack="local"/></request>
<request><jabber type="auth_sasl_bind" ack="local"></jabber></request>
<request><jabber type="auth_sasl_session" ack="local"></jabber></request>
</transaction>
<request><jabber type="presence:initial" ack="no_ack"/></request>
<thinktime value="300000"></thinktime>
</session>
</sessions>
</tsung>
2)启动
./tsung -f xmppLogin.xml start
三、问题描述
==============
使用该脚本测试的时候,要禁用XMPP服务器的auth验证模块,不然账号密码不对,登陆不进去。
单个IP的端口65535的问题导致单个机器模拟的连接数有限,这个问题我没解决,只能通过使用很多机器都开这个服务来解决。
四、相关文档
==============
http://tsung.erlang-projects.org/ http://www.ec-os.net/misc/Tsung.html
相关文章推荐
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web压力测试工具:http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- 服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Linux下进行Web服务器压力(并发)测试工具http_load、webbench、ab、Siege、autobench简单使用教程(转)
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Linux下Web性能压力测试工具http_load使用教程
- Linux下Web性能压力测试工具http_load使用教程
- Web服务器压力测试工具http load使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程 - VPS侦探
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web压力测试工具:http_load、webbench、ab、Siege使用教程
- Web服务器压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
- Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程