[Tsung] Maximize Connections

Zach Calvert zachcalvert at hemerasoftware.com
Mon Jul 9 18:53:35 CEST 2012


Figured out it was due to limitations on ephemeral port range.

Modify the OS to allow a larger number of ephemeral ports. This should
be done in /etc/sysctl.conf file with the following values:

# define ephemeral port ranges
net.ipv4.ip_local_port_range = 8192 65535

On Mon, Jul 9, 2012 at 10:33 AM, Zach Calvert
<zachcalvert at hemerasoftware.com> wrote:
> I'm finding a hard limit with my tsung client at around 28,000
> connected users.  I was expecting somewhere in the range of 50,000
> (port limit) but the tsung client hangs below 28,500.  There are no
> errors in my logs and I have configured ulimit.  I'm also not running
> background ports:
>
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>ulimit -Hn
> 100000
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>ulimit -Sn
> 100000
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>netstat -an | wc -l
> 28497
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>cat
> ~/.tsung/log/20120709-1016/tsung_controller\@sol101.log | grep ERR
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>cat
> ~/.tsung/log/20120709-1016/tsung_controller\@sol101.log | grep Err
>
> My tsung XML looks like:
> <?xml version="1.0"?>
> <!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
> <tsung loglevel="notice" version="1.0">
>
>    <clients>
>      <client host="sol101" weight="1" maxusers="60000">
>         <ip value="1.1.1.1"></ip> <!-- no this is not the real IP address -->
>      </client>
>    </clients>
>
>  <servers>
>   <server host="sol102" port="5222" type="ssl"></server>
>  </servers>
>
>   <load>
>    <arrivalphase phase="1" duration="20" unit="minute">
>     <users interarrival="0.015" unit="second"></users>
>    </arrivalphase>
>   </load>
>
>  <options>
>   <option type="ts_jabber" name="global_number" value="60001"></option>
>   <option type="ts_jabber" name="userid_max" value="60000"></option>
>   <option type="ts_jabber" name="domain" value="ejd.perf"></option>
>   <option type="ts_jabber" name="username" value="tstest_"></option>
>   <option type="ts_jabber" name="passwd" value="tstest_"></option>
>  </options>
>
>   <sessions>
>    <session probability="100" name="xmpp-connection" type="ts_jabber">
>
>     <request>
>        <jabber type="connect" ack="no_ack"></jabber>
>     </request>
>
>     <thinktime value="2"></thinktime>
>
>     <transaction name="authenticate">
>       <request> <jabber type="auth_get" ack="no_ack"></jabber> </request>
>       <request> <jabber type="auth_set_plain" ack="no_ack"></jabber> </request>
>     </transaction>
>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi"
> ack="no_ack"></jabber></request>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi
> again" ack="no_ack"></jabber></request>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi"
> ack="no_ack"></jabber></request>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi
> again" ack="no_ack"></jabber></request>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi"
> ack="no_ack"></jabber></request>
>
>     <thinktime value="120"></thinktime>
>     <request><jabber type="presence:directed" show="chat" status="hi
> again" ack="no_ack"></jabber></request>
>
>     <thinktime value="1200"></thinktime>
>
>     <transaction name="close">
>       <request> <jabber type="close" ack="no_ack"></jabber> </request>
>     </transaction>
>
>   </session>
>  </sessions>
> </tsung>
>
> I get under 28500 before I hit a hard limit.  Is there an erlang max
> port configuration, or something to do with limits of linux that I'm
> hitting?  Also, once I max out, running tsung stop generates:
>
> {error_logger,{{2012,7,9},{10,30,58}},"Protocol: ~p: register error:
> ~p~n",["inet_tcp",{{badmatch,{error,eaddrinuse}},[{inet_tcp_dist,listen,1,[{file,"inet_tcp_dist.erl"},{line,70}]},{net_kernel,start_protos,4,[{file,"net_kernel.erl"},{line,1314}]},{net_kernel,start_protos,3,[{file,"net_kernel.erl"},{line,1307}]},{net_kernel,init_node,2,[{file,"net_kernel.erl"},{line,1197}]},{net_kernel,init,1,[{file,"net_kernel.erl"},{line,357}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}]}
> {error_logger,{{2012,7,9},{10,30,58}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.21.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,320}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[#Port<0.136>,<0.18.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,24},{reductions,782}],[]]}
> {error_logger,{{2012,7,9},{10,30,58}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[[killer,shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
> {error_logger,{{2012,7,9},{10,30,58}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
> {error_logger,{{2012,7,9},{10,30,58}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
> {"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}
> Kernel pid terminated (application_controller)
> ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
> zach at sol101:/var/tmp/zach/tsung/tsung-1.4.2>>
>
> But if I stop it before it maxes out, it works as desired.  I'm not
> anywhere near 50,000 in port uses.  Am I missing some configuration?
>
>
>
>
> Thank you,
> Zach Calvert


More information about the Tsung-users mailing list