Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8829

Make SO_RCVBUF and SO_SNDBUF size configurable for DataTransferProtocol sockets and allow configuring auto-tuning

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0, 2.6.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1, 2.7.5
    • Component/s: datanode
    • Labels:
      None
    • Target Version/s:
    • Release Note:
      Hide
      HDFS-8829 introduces two new configuration settings: dfs.datanode.transfer.socket.send.buffer.size and dfs.datanode.transfer.socket.recv.buffer.size. These settings can be used to control the socket send buffer and receive buffer sizes respectively on the DataNode for client-DataNode and DataNode-DataNode connections. The default values of both settings are 128KB for backwards compatibility. For optimum performance it is recommended to set these values to zero to enable the OS networking stack to auto-tune buffer sizes.
      Show
      HDFS-8829 introduces two new configuration settings: dfs.datanode.transfer.socket.send.buffer.size and dfs.datanode.transfer.socket.recv.buffer.size. These settings can be used to control the socket send buffer and receive buffer sizes respectively on the DataNode for client-DataNode and DataNode-DataNode connections. The default values of both settings are 128KB for backwards compatibility. For optimum performance it is recommended to set these values to zero to enable the OS networking stack to auto-tune buffer sizes.

      Description

        private void initDataXceiver(Configuration conf) throws IOException {
          // find free port or use privileged port provided
          TcpPeerServer tcpPeerServer;
          if (secureResources != null) {
            tcpPeerServer = new TcpPeerServer(secureResources);
          } else {
            tcpPeerServer = new TcpPeerServer(dnConf.socketWriteTimeout,
                DataNode.getStreamingAddr(conf));
          }
          tcpPeerServer.setReceiveBufferSize(HdfsConstants.DEFAULT_DATA_SOCKET_SIZE);
      

      The last line sets SO_RCVBUF explicitly, thus disabling tcp auto-tuning on some system.

      Shall we make this behavior configurable?

        Attachments

        1. HDFS-8829.0001.patch
          13 kB
          He Tianyi
        2. HDFS-8829.0002.patch
          14 kB
          He Tianyi
        3. HDFS-8829.0003.patch
          16 kB
          He Tianyi
        4. HDFS-8829.0004.patch
          14 kB
          He Tianyi
        5. HDFS-8829.0005.patch
          14 kB
          He Tianyi
        6. HDFS-8829.0006.patch
          14 kB
          He Tianyi

          Issue Links

            Activity

              People

              • Assignee:
                He Tianyi He Tianyi
                Reporter:
                He Tianyi He Tianyi
              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: