Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234191

Non-blocking write exhibits poor performance with small SO_SNDBUF on Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6u45, 7u80, 8u212, 9.0.4, 11.0.3-oracle, 13.0.1
    • core-libs

      This originally emerged via this issue on Apache Tomcat.
      https://bz.apache.org/bugzilla/show_bug.cgi?id=63916

      The issue has been reduced to this simple test case:
      https://github.com/markt-asf/tomcat-bugs/blob/master/src/java/org/apache/tomcat/Bug63916NioPoller.java

      The test case uses 1 thread as a Poller (with a Selector) and dispatches writes to a separate thread. The test case tries to write 10MB to a single connection as quickly as possible.

      While the detail of the results vary - largely due to differences in test hardware - the general pattern is that on most platforms smaller values for SO_SNDBUF result in slightly worse performance of the test case but performance remains acceptable for all buffer sizes.

      On Linux, things are very different. At some point, typically between 4k and 5k but it does vary, performance gets significantly - 2 orders of magnitude - worse.

      We have tested various operating systems, various Java versions from various vendors and various SelectorProvider implementations. This appears to be Linux specific, affects the current latest release and goes back to at least Java 6.

            michaelm Michael McMahon
            markt Mark Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: