[erlang-questions] 回复: ERL_MAX_PORTS has no effect

Tony Rogvall tony@REDACTED
Sat Jul 13 15:19:54 CEST 2013


Hi!

Setting the ulimit works nicely with files, but not so nice with sockets.
You wont notice until the driver start using driver_select and thereby, indirectly, using
the system call select. 
I suspected that "erl +K true", enable kernel poll (kqueue for max os x),  should do the trick. But, not.
There is still a check for max_fds that triggers somewhere which is unfortunate.

This is on R15, have not checked R16 yet.

Rickard Green may now more about the status on max_fds ?

Regards

/Tony


On 13 jul 2013, at 15:04, goofansu <goofan.su@REDACTED> wrote:

> Hi, Anthony
> 
> Thank you for the explanation.
> 
> I tested on the VPS again and set `ulimit -n` to a number like 4096 takes effects.
> 
> I'm running Riak so cannot upgrade to R16B01 now.
> 
> 
> Kind Regards,
> 
> --
> goofansu
> 
> 
> -- 
> Kind Regards
> goofansu
> 
> 在 2013年7月13日星期六,下午8:08,Anthony Ramine 写道:
> 
>> Hello,
>> 
>> ERL_MAX_PORTS sets the maximum number of running ports. Not the maximum number of file descriptors.
>> 
>> I guess you are running OS X which has a broken poll implementation and Erlang is forced to use select(), which is limited to FD_SETSIZE file descriptors. Fortunately, OS X's select() implementation can also be made to support an infinite number of file descriptors through a macro which I taught Erlang/OTP to use. Upgrade to R16B01 and you should be fine.
>> 
>> Regards,
>> 
>> --
>> Anthony Ramine
>> 
>> Le 13 juil. 2013 à 08:34, goofansu a écrit :
>> 
>>> I encounted "fd=1024 is larger than the largest allowed fd=1023", then I set the ERL_MAX_PORTS variable when start the erlang vm. But it takes no effect.
>>> 
>>> $ erl -env ERL_MAX_PORTS 4096
>>> 
>>> Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false]
>>> 
>>> Eshell V5.9.1 (abort with ^G)
>>> 1> erlang:system_info(check_io).
>>> [{name,erts_poll},
>>> {primary,select},
>>> {fallback,false},
>>> {kernel_poll,false},
>>> {memory_size,6344},
>>> {total_poll_set_size,2},
>>> {lazy_updates,true},
>>> {pending_updates,0},
>>> {batch_updates,false},
>>> {concurrent_updates,false},
>>> {max_fds,1024}]
>>> 2>
>>> 
>>> The max_fds is always 1024.
>>> 
>>> --
>>> Kind Regards
>>> goofansu
>>> 
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

"Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130713/da05c925/attachment.htm>


More information about the erlang-questions mailing list