0

我已经用 tsung 测试了套接字。

tsung.xml:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">

  <!-- Client side setup -->
  <clients>
    <client host="localhost" use_controller_vm="true" maxusers="10000"/>
  </clients>

  <!-- Server side setup -->
<servers>
  <server host="127.0.0.1" port="5678" type="tcp"/>
</servers>

  <!-- to start os monitoring (cpu, network, memory). Use an erlang
  agent on the remote machine or SNMP. erlang is the default -->
  <!-- <monitoring>
    <monitor host="localhost"></monitor>
  </monitoring> -->

  <!-- <load duration="1" unit="minute" loop="3"> -->
  <load loop="3">
  <arrivalphase phase="1" duration="1" unit="minute">
    <!-- <users interarrival="0.001" unit="second"></users> -->
    <users arrivalrate="200" unit="second" />
  </arrivalphase>
 </load>
<!--
  <options>
   <option type="ts_http" name="user_agent">
    <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
    <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
   </option>
  </options>
 -->
  <!-- start a session for a http user. the probability is the
  frequency of this type os session. The sum of all session's
  probabilities must be 100 -->

 <sessions>
  <session probability="100" name="socket-example" type="ts_socket">
    <request>
      <socket></socket>
    </request>
  </session>
 </sessions>
</tsung>

几乎在每个阶段,我都收到了报告:Phase duration exceeded, but not all users were launched,就像以下内容一样:

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
    ts_config_server:(5:<0.50.0>) All remote beams started, sync 

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
    ts_config_server:(5:<0.50.0>) New arrival phase 1 for client "localhost" (last ? true): will start 6000 users

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
    ts_config_server:(5:<0.50.0>) New arrival phase 2 for client "localhost" (last ? true): will start 6000 users

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
    ts_config_server:(5:<0.50.0>) New arrival phase 3 for client "localhost" (last ? true): will start 6000 users

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
    ts_config_server:(5:<0.50.0>) New arrival phase 4 for client "localhost" (last ? true): will start 6000 users

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
         ts_launcher:(5:<0.84.0>) Expected duration of first phase: 60.0 sec (6000 users) 

=INFO REPORT==== 21-Sep-2012::14:28:44 ===
         ts_launcher:(5:<0.84.0>) Activate launcher (6000 users) in 10019 msec 

=INFO REPORT==== 21-Sep-2012::14:29:54 ===
         ts_launcher:(5:<0.84.0>) Phase duration exceeded, but not all users were launched (440 users, 7.3% of phase)

有什么问题吗?

4

1 回答 1

1

您确定那是与该日志关联的 tsung.xml 吗?看起来您只指定了 1 个阶段,而日志显示 4 ......或者该循环是否同样地回收了第一个阶段,再循环 3 次?

不知道你对 Tsung 有多熟悉,我几周前才开始使用它,我发现它不是开玩笑的。非常强大。我不得不重新调整它,因为它可以非常邪恶地扩展、分配和强制增加负载。

看起来你已经把它设置得有点粗壮了。已经很晚了,我的数学从来都不是很好,但看起来你在一分钟内每秒都在爆破 200,000 个 http get。继续乘以 200,000 x 3 以获得每秒的最小数据包。那是你的意图吗?

我所做的就是将其一直降低到 1 个用户每秒 1 次到达 1 分钟,看看它是否会自行停止并感受它的加载能力

于 2012-09-30T10:47:41.543 回答