Ubuntu 下增加最大连接数? (Tsung并发测试)

发布于 2024-10-10 05:33:37 字数 1391 浏览 0 评论 0原文

我正在测试 NodeJ,尤其是并发性。我为此使用 Tsung。 不幸的是,Tsung 似乎无法产生足够的用户。尽管仍有约 2GB RAM 未使用,但我仅获得约 30K 并发连接。 (检查图表

XML 配置文件如下:

<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>

那么如何增加用户,以便使用所有 RAM ???

I am testing NodeJs, especially the concurrency. I am using Tsung for this.
Unfortunately Tsung seems not be able to spawn enough users. I'm only getting about 30K simultaneous connections although ~2GB RAM is still unused. (Check the charts)

The XML-Config File is the following:

<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>

So how to increase the users, so that all the RAM is used???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

べ映画 2024-10-17 05:33:37

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

I solved the problem!!! I just needed to increase the Port Range. With 4GB RAM i reach nearly the max possible Port Range. Exactly 61980 simultaneous connections. Great NodeJs!

审判长 2024-10-17 05:33:37

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

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

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

Depending on your CPU architecture, node might only support 1GB of RAM: http://code.google.com/p/v8/issues/detail?id=847

To work around this you can run multiple instances of node (and have them talk to each other if needed). Libraries like multi-node can help with this: https://github.com/kriszyp/multi-node

Otherwise you need to look into tuning your server for lots of long running connections - outside my expertise but there are lots of people thinking about this. Here's a thread from the nodejs Google Group about supporting 100k connections: https://groups.google.com/d/topic/nodejs/0Z34PH_R88o/discussion

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文