MINA SSHD
  1. MINA SSHD
  2. SSHD-164

Allow the buffer size for the IO pumps to be configurable in InvertedShellWrapper

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.7.0
    • Labels:
      None

      Description

      InvertedShellWrapper uses by default a buffer of 512 bytes to copy the input/output/error streams from the shell to the socket. For some applications, this is way too low, as for example, copying 1MB from the process output to the socket is going to require in the 2048 loop iterations in the IO pump thread.

      For example, in our tests, switching the buffer size from 512 bytes to 32kBytes, on the transmission of 830Mb leads to an improvement from 1m30s for the 512b buffer to 1m15s for the 32k buffer, saving of 1/6th of the overall transmission time.

      1. SSHD-164.patch
        2 kB
        Pierre-Etienne Poirot

        Activity

        Pierre-Etienne Poirot created issue -
        Hide
        Pierre-Etienne Poirot added a comment -

        Patch.

        Show
        Pierre-Etienne Poirot added a comment - Patch.
        Pierre-Etienne Poirot made changes -
        Field Original Value New Value
        Attachment SSHD-164.patch [ 12525719 ]
        Pierre-Etienne Poirot made changes -
        Description InvertedShellWrapper uses by default a buffer of 512 bytes to copy the input/output/error streams from the shell to the socket. For some applications, this is way too low, as for example, copying 1MB from the process output to the socket is going to require 2048 loop iterations in the IO pump thread, and introduce a 2s of latency because of the 1ms sleep at the end of each loop iteration.

        Instead the buffer size should be configurable by the command factory.
        InvertedShellWrapper uses by default a buffer of 512 bytes to copy the input/output/error streams from the shell to the socket. For some applications, this is way too low, as for example, copying 1MB from the process output to the socket is going to require in the 2048 loop iterations in the IO pump thread.

        For example, in our tests, switching the buffer size from 512 bytes to 32kBytes, on the transmission of 830Mb leads to an improvement from 1m30s for the 512b buffer to 1m15s for the 32k buffer, saving of 1/6th of the overall transmission time.
        Hide
        Guillaume Nodet added a comment -

        Patch applied with many thanks. I've raised the default value a bit too.

        Show
        Guillaume Nodet added a comment - Patch applied with many thanks. I've raised the default value a bit too.
        Guillaume Nodet made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Guillaume Nodet [ gnt ]
        Fix Version/s 0.7.0 [ 12317953 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Pierre-Etienne Poirot
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development