我已经用 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)
有什么问题吗?