我正在使用tsung测试websockets,我可以实现4820个连接,之后我收到此错误,我已经将打开的文件限制增加到 kern.maxfilesperproc:64000 kern.maxfiles:524288
我想以50000个连接为例。我使用sierra os 10.12.6从mac book pro加载测试
=ERROR REPORT==== 20-Oct-2017::16:30:41 ===
** Generic server <0.5350.0> terminating
** Last message in was {'EXIT',<0.5437.0>,
{emfile,
[{erlang,open_port,
[{spawn,"/bin/sh -s unix:cmd"},
[binary,stderr_to_stdout,stream,in,hide,out]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,239}]},
{ts_os_mon_erlang,get_os_data,2,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,297}]},
{ts_os_mon_erlang,node_data,0,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,227}]},
{ts_os_mon_erlang,updatestats,3,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,172}]}]}}
** When Server state == {state,{global,ts_mon},
10000,'tsung_controller@Simons-MacBook-Pro',
"Simons-MacBook-Pro",<0.5437.0>,false,[]}
** Reason for termination ==
** {function_clause,
[{ts_os_mon_erlang,handle_info,
[{'EXIT',<0.5437.0>,
{emfile,
[{erlang,open_port,
[{spawn,"/bin/sh -s unix:cmd"},
[binary,stderr_to_stdout,stream,in,hide,out]],
[]},
{os,cmd,1,[{file,"os.erl"},{line,239}]},
{ts_os_mon_erlang,get_os_data,2,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,297}]},
{ts_os_mon_erlang,node_data,0,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,227}]},
{ts_os_mon_erlang,updatestats,3,
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},
{line,172}]}]}},
{state,
{global,ts_mon},
10000,'tsung_controller@Simons-MacBook-Pro',
"Simons-MacBook-Pro",<0.5437.0>,false,[]}],
[{file,"src/tsung_controller/ts_os_mon_erlang.erl"},{line,121}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,616}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,686}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ulmit -a
Simons-MacBook-Pro:bin simoncigoj$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 640000
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 709
virtual memory (kbytes, -v) unlimited
jetty websocket app中的错误:
java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
at org.eclipse.jetty.server.ServerConnector.accept(ServerConnector.java:379)
at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:643)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
at java.lang.Thread.run(Thread.java:748)