[erlang-questions] Reasons not to enable kernel poll

Bernie Duggan bernie@REDACTED
Sat Apr 9 01:52:59 CEST 2011


It's worth noting that there are certain (relatively unusual) cases where
epoll() has significantly worse performance than poll(). The particular case
i'm thinking of is where you have a high number of open sockets and, each
time (e)poll is called, a significant majority have data waiting on them.
This is, as I said, a pretty unusual use pattern, and not something 95% of
people will ever strike. But it's worth keeping in mind  that the blanket
statement "epoll is always faster/better" is not /always/ true. Of course,
in the case I just described, it would be well worth asking whether you need
poll/epoll at all, but that's beside my point.
All I'm really saying is that, in the vast majority of cases enabling kernel
polling will indeed improve matters, sometimes drastically, but if your
application does anything even slightly interesting network-wise then it's
well worth measuring rather than assuming.

Cheers,

B

On 9 April 2011 04:12, Kaiduan Xie <kaiduanx@REDACTED> wrote:

> Some OS, for example, Windows, does not have kernel poll support. So
> it is not enabled by default.
>
> On Linux, it uses ePoll and is quite stable. It improves the
> performance dramatically if you have a lot of concurrent open sockets.
>
> /Kaiduan
>
> On Thu, Apr 7, 2011 at 1:54 AM, Alexey Romanov
> <alexey.v.romanov@REDACTED> wrote:
> > From reading, e.g.
> > http://developer.sipphone.com/ejabberd/erlang_epoll_patch/, it seems
> > supposed to be a performance improvement which only some applications
> > can benefit from, but with no downsides. Presumably it's now
> > considered stable (after inclusion into OTP and 3 major versions).
> > Rebar enables it by default (see
> >
> https://github.com/basho/rebar/blob/master/priv/templates/simplenode.vm.args
> ).
> > But why is it required to enable it and "+K true" isn't the default?
> > Are there circumstances when it's a bad idea to enable it?
> >
> > Yours, Alexey Romanov
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110409/f9fb65eb/attachment.htm>


More information about the erlang-questions mailing list