【问题标题】:Increase Max Connections under Ubuntu? (Tsung concurrency test)增加 Ubuntu 下的最大连接数? (Tsung 并发测试)
【发布时间】:2011-06-03 16:34:29
【问题描述】:

我正在测试 NodeJ,尤其是并发性。我正在为此使用Tsung。 不幸的是,Tsung 似乎无法产生足够多的用户。我只获得了大约 30K 的同时连接,尽管 ~2GB RAM 仍未使用。 (Check the charts)

XML-Config 文件如下:

<tsung loglevel="notice" version="1.0">
<!-- Client side setup -->
−
<clients>
<client host="localhost" use_controller_vm="false"/>
<client host="localhost" use_controller_vm="false"/>
</clients>
<!-- Server side setup -->
−
<servers>
<server host="localhost" port="8000" 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" type="erlang"/>
</monitoring>
−
<load>
−    
<arrivalphase phase="1" duration="50" unit="minute">
<users interarrival="0.000000001" unit="second"/>
</arrivalphase>
</load>
−
<sessions>
−
<session name="nodeJS" probability="100" type="ts_http">
−
<for from="0" to="40" incr="1" var="counter">
−
<request>
<http url="http://localhost:8000/" version="1.1" method="GET"/>
</request>
<thinktime random="false" value="300"/>
</for>
</session>
</sessions>
</tsung>

那么如何增加用户,让内存全部用完???

【问题讨论】:

    标签: node.js tsung


    【解决方案1】:

    我解决了这个问题!!!我只需要增加端口范围。使用 4GB RAM,我几乎达到了最大可能的端口范围。正好 61980 个同时连接。很棒的 NodeJ!

    【讨论】:

    • 关于实现这一点的任何其他提示?您最终会使用大部分 RAM 吗?设置是什么 - 我知道仅支持 1GB RAM 的节点存在问题。
    【解决方案2】:

    根据您的 CPU 架构,节点可能仅支持 1GB 内存:http://code.google.com/p/v8/issues/detail?id=847

    要解决这个问题,您可以运行多个节点实例(并在需要时让它们相互通信)。像多节点这样的库可以帮助解决这个问题:https://github.com/kriszyp/multi-node

    否则,您需要考虑调整您的服务器以实现大量长时间运行的连接——这超出了我的专业知识范围,但有很多人在考虑这个问题。这是来自 nodejs Google Group 的关于支持 100k 连接的帖子:https://groups.google.com/d/topic/nodejs/0Z34PH_R88o/discussion

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-13
      • 1970-01-01
      • 1970-01-01
      • 2012-08-25
      • 2021-12-10
      • 2019-12-10
      • 2013-03-30
      • 2013-09-29
      相关资源
      最近更新 更多