Increase Max Connections under Ubuntu? (Tsung concurrency test)
Asked Answered
F

2

1

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

Fagin answered 4/1, 2011 at 22:0 Comment(0)
T
3

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!

Teddie answered 8/1, 2011 at 15:32 Comment(1)
Any additional tips on making this happen? Do you end up using most of the RAM? What's the setup - I know there are issues on node only supporting 1GB RAM.Candytuft
S
0

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

Sunward answered 4/1, 2011 at 22:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.