Hi Yingqi,
I think we should consider making it a standard option if there is
a reasonable prospect that all the major platforms will eventually
support it.
Even if a particular platform does not support it initially (such as
Windows)
the API allows for this possibility by throwing
UnsupportedOperationException
on the set and get methods.
The jdk.net API is probably more intended for options that are less
likely to
be widely supported.
- Michael
On 19/11/15 16:40, Lu, Yingqi wrote:
Hi Michael,
Thank you very much for your email.
The version 1 of the patch is already uploaded at
http://cr.openjdk.java.net/~mcberg/jdk/6432031/webrev.01/
<http://cr.openjdk.java.net/%7Emcberg/jdk/6432031/webrev.01/>. The
link is also available from
https://bugs.openjdk.java.net/browse/JDK-6432031.
We just completed the version 2 which implements the SO_REUSEPORT as
an extended socket option (jdk.net.ExtendedSocketOptions) instead of a
standard one (Following Alan Bateman’s suggestion). The patch will be
uploaded very soon hopefully today. If we have issues uploading it, we
will let you know. Once we are done uploading, we will notify this
community.
Thanks,
Yingqi Lu (Lucy)
*From:*net-dev [mailto:net-dev-boun...@openjdk.java.net] *On Behalf Of
*Michael McMahon
*Sent:* Thursday, November 19, 2015 6:11 AM
*To:* Kharbas, Kishor; net-dev@openjdk.java.net
*Subject:* Re: Patch for adding SO_REUSEPORT socket option
Hi Kishor
Did you mean to include the patch with this message?
If you send it, I can convert it to a webrev and put
it on the cr.openjdk server for review
Thanks
Michael
On 16/11/15 18:49, Kharbas, Kishor wrote:
Hello all,
I request the community to review a patch for adding SO_REUSEPORT
support. There is already an existing JBS opened at
https://bugs.openjdk.java.net/browse/JDK-6432031
Details :
SO_REUSEPORT removes 1:1 assignment between listen socket and
IP:PORT pair and enable multiple sockets listening to the same
address and port. This improves the scalability and parallelism of
network traffic handling. It is enabled for both TCP and UDP
sockets (at least for Linux). For more details, please refer to
https://lwn.net/Articles/542629/. Many applications, especially
Linux or BSD based webservers such as Apache httpd and Nginx are
already supporting it now. Ruby and Python have it supported as
well. Other Java applications such as Netty webserver have it
supported via JNI function since JDK has not supported it yet.
By enabling the SO_REUSEPORT feature itself, up to 4X throughput
and latency improvement have been observed from various
applications. Specific to Java application with this patch, we
modified Apache Hadoop Distributed File System (HDFS) source code
to take advantage of this feature. We observed up to 1.93x
performance improvements.
The feature is supported since Linux Kernel 3.9. It is also
supported in BSDs, Solaris and Mac OS. Windows does not have it.
In the current patch, we only enable the feature on Linux platform
since we do not have BSD, Solaris and Mac OS for testing. Whether
the feature is supported or not on the running kernel is
determined at the run time.
P.S. Based on Alan Baleman's comment on JBS, we are in meanwhile
working on adding this option to 'java.net.ExtendedSocketOption'.
Regards,
Kishor Kharbas