Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Jetty + SO_REUSEPORT

Hi,

On Wed, Sep 24, 2014 at 2:20 PM, Jarym <emrul.i@xxxxxxxxx> wrote:
> Hello,
>
> I'm creating an embedded Jetty server and want to use a socket option
> SO_REUSEPORT (*nix specific socket option that allows multiple processes to
> bind to the same port).
>
> Java doesn't include this as a named setting since it is platform specific
> (works on *nix, not on Windows).  The  Netty project have implemented it
> natively here:
> https://github.com/netty/netty/commit/d1d8a6b6cdfbf3946fbce0a7a0bf7657cbfade03
>
> I'm wondering what is the best way to go about adding this feature myself?
> I'm not so familiar with the Netty codebase but am prepared to attempt to
> add this and contribute my changes back if I could get some pointers.
>
> Alternatively, if there is a lazy way I can leverage Netty's implementation
> when constructing my Jetty server please suggest it.

In Jetty the number of acceptors can be configured.
For example, if it is 2 there are 2 competing threads accepting
connections, so that when one is performing the code after the accept,
the other is ready to accept.

Unless you have a very high socket connection rate, it is unlikely
that Jetty will slow you down.

Jetty currently does not maintain native code.
My take is that for this particular feature it seems the ratio
benefit/work is too small.

On the other hand, if you want to contribute to Jetty, we can guide
you to what can be done.

Thanks !

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top