Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4494

Increase Java Socket Buffer Size

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.11.0
    • 0.12.0
    • Java - Library
    • None

    Description

      TSocket.java
        if (isOpen()) {
            try {
              inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
              outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
            } catch (IOException iox) {
              close();
              throw new TTransportException(TTransportException.NOT_OPEN, iox);
            }
          }
      

      The 1024 buffer size is pretty narrow, especially for modern servers with TCP/IP send and receive buffers ranging from 16K to 64K. Please remove these hard coded values and rely on the underlying JVM default buffer sizes: 8Kib on most implementations.

      https://github.com/apache/thrift/blob/19baeefd8c38d62085891d7956349601f79448b3/lib/java/src/org/apache/thrift/transport/TSocket.java

      Attachments

        1. THRIFT-4494.1.patch
          1 kB
          David Mollitor

        Issue Links

          Activity

            People

              jking3 James E. King III
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: