一、部署安装 ============== 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 - xml version="1.0"?>
- >
- <tsung loglevel&#61;"notice" version&#61;"1.0">
-
-
- <clients>
- <client host&#61;"localhost" use_controller_vm&#61;"true" maxusers&#61;"60000">client>
- clients>
-
-
- <servers>
- <server host&#61;"127.0.0.1" port&#61;"5222" type&#61;"tcp">server>
- servers>
-
-
- <load>
- <arrivalphase phase&#61;"1" duration&#61;"60" unit&#61;"minute">
- <users arrivalrate&#61;"50" unit&#61;"second">users>
- arrivalphase>
- load>
-
-
- <options>
- <option type&#61;"ts_jabber" name&#61;"global_number" value&#61;"100">option>
- <option type&#61;"ts_jabber" name&#61;"userid_max" value&#61;"1000000">option>
- <option type&#61;"ts_jabber" name&#61;"domain" value&#61;"wemomo.com">option>
- <option type&#61;"ts_jabber" name&#61;"username" value&#61;"1602">option>
- <option type&#61;"ts_jabber" name&#61;"passwd" value&#61;"1602">option>
- options>
-
-
- <sessions>
- <session probability&#61;"100" name&#61;"jabber-example" type&#61;"ts_jabber">
- <request><jabber type&#61;"connect" ack&#61;"no_ack">jabber>request>
- <transaction name&#61;"authenticate">
- <request><jabber type&#61;"auth_sasl" ack&#61;"local"/>request>
- <request><jabber type&#61;"auth_sasl_bind" ack&#61;"local">jabber>request>
- <request><jabber type&#61;"auth_sasl_session" ack&#61;"local">jabber>request>
- transaction>
- <request><jabber type&#61;"presence:initial" ack&#61;"no_ack"/>request>
-
- <thinktime value&#61;"300000">thinktime>
- session>
- sessions>
- tsung>
2)启动 ./tsung -f xmppLogin.xml start 三、问题描述 &#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;
使用该脚本测试的时候&#xff0c;要禁用XMPP服务器的auth验证模块&#xff0c;不然账号密码不对&#xff0c;登陆不进去。
单个IP的端口65535的问题导致单个机器模拟的连接数有限&#xff0c;这个问题我没解决&#xff0c;只能通过使用很多机器都开这个服务来解决。 四、相关文档 &#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61; http://tsung.erlang-projects.org/ http://www.ec-os.net/misc/Tsung.html