Resteasy服务波的TPS(每秒事务数)

时间:2014-06-19 02:28:41

标签: java jetty resteasy performance-testing tsung

我有一个REST服务由resteasy框架编写,部署到Jetty Web容器。

Tsung计算的TPS表现点如下图所示

enter image description here

我调试了一些参数,但没有work.note代码可以被其他团队验证。


  • Jetty的线程号
  • JVM的GC
  • OS的TCP内核参数

我不知道为什么。谁可以提供一些调试参数或提出结果的问题。

非常感谢提前

以下是Tsung的配置


<?xml version="1.0"?><tsung loglevel="notice" version="1.5.0">
  <clients>
    <client host="tc-1" maxusers="50000" weight="1"/>
    <client host="tc-3" maxusers="50000" weight="1"/>
    <client host="tc-4" maxusers="50000" weight="1"/>
  </clients>
  <servers>
    <server host="service-ip" port="80" type="tcp"/>
  </servers>
  <monitoring>
    <monitor host="tc-1" type="erlang"/>
    <monitor host="tc-3" type="erlang"/>
    <monitor host="tc-4" type="erlang"/>
  </monitoring>
  <load duration="500" unit="second">
    <arrivalphase duration="500" phase="1" unit="second">
        <users arrivalrate="700" unit="second"/>
    </arrivalphase>
  </load>
  <options>
    <option name="user_agent" type="ts_http">
      <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>
    <option max="60000" min="1025" name="ports_range"/>
    <option name="seed" value="58989679"/>
  </options>
  <sessions>
    <session name="mytest" probability="100" type="ts_http">
        <request subst="true">
          <http content_type="application/json" method="GET" url="/mydata" version="1.1">
            <www_authenticate passwd="pwd" userid="username"/>
          </http>
        </request>
    </session>
  </sessions>
</tsung>

1 个答案:

答案 0 :(得分:0)

您应首先降低日志级别(例如,警告)。

你的请求/秒怎么样?我可以想象你已经超载了你的tsung控制器节点。您是否看过您的tsung群集的资源利用率?

您还应该尝试为每个会话发出多个请求,因为创建会话/用户需要资源而且不是免费的。例如每个会话10个req​​并且从1/10开始,用户应该产生相同的请求率,但是也应该减少启动新会话的额外成本。