在Ubuntu下增加最大连接数? (Tsung并发testing)

我正在testingNodeJs,尤其是并发性。 我正在用这个。 不幸的是Tsung似乎无法产生足够的用户。 我只能得到大约30K的同时连接,虽然〜2GB内存仍未使用。 ( 查看图表 )

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> 

那么如何增加用户,让所有的RAM都被使用?

我解决了这个问题! 我只需要增加端口范围。 随着4GB的RAM我达到了接近最大可能的端口范围。 恰好61980同时连接。 很棒的NodeJs!

根据您的CPU架构,节点可能只支持1GB的RAM: 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