Tuning MassTransit

MassTransit allows you to tune the MassTransit protocol (TCP/IP, TCP Secure, and UDT) in order to increase the MassTransit performance. In addition, there are specific tuning settings which can be configured for the TCP/IP and UDP protocols.

MassTransit Protocol Tuning Settings

The MassTransit protocol is a set of rules for the TCP/IP, TCP/IP Secure, and UDT connections. To tune the MassTransit protocol, follow these steps:

  1. Open the MassTransitEngine.cfg configuration file in an application suitable for plain text edit. The file is located in the installation directory of MassTransit which by default is located in:
    1. for MassTransit 7.6 and later:
      • on 64-bit machines:

      C:\Program Files (x86)\Acronis\MassTransit Server

    2. for MassTransit 7.1 to 7.6:
      • on 32-bit machines:

      C:\Program Files\Group Logic\MassTransit Server

      • on 64-bit machines:

      C:\Program Files (x86)\Group Logic\MassTransit Server

    3. for MassTransit 7.0.x:
      • on 32-bit machines:

      C:\Program Files\Group Logic\MassTransit Server 7

      • on 64-bit machines:
      • C:\Program Files (x86)\Group Logic\MassTransit Server 7
  2. Locate the MassTransit protocol tuning settings area and configure the desired settings:

    Note: Uncomment the settings you configure if they are commented out in order to activate them. You can do that by deleting the '%%' at the beginning of the line.

    1. MTP_XFER_BLOCK_SIZE_FACTOR = 89 – configures the size of the blocks used when transferring files in bytes; represents the multiplication factor of TCP maximum segment size (MSS). The maximum segment size is an option of the TCP protocol that specifies the largest amount of data that a computer can receive in a single, unfragmented piece. Here are some example values of the multiplication factor for Ethernet MSS of 1460:

    FACTOR - XFER_BLOCK_SIZE

    16K - 11 x 1460 = 16060 - 64 = 15996

    32K - 22 x 1460 = 32120 - 64 = 32056

    64K - 44 x 1460 = 64240 - 64 = 64176

    128K- 89 x 1460 = 129940 - 64 = 129876

    256K - 179 x 1460 = 261340 - 64 = 261276

    1M - 718 x 1460 = 1048280 - 64 = 1048216

    1. MTP_DISABLE_DISK_IO_READS = FALSE – when set to TRUE, all reading from disk during a file transfer is disabled and the random contents of any buffer are sent instead. Used for eliminating disk I/O (in/out) performance issues when trying to tune network throughput.
    2. MTP_DISABLE_DISK_IO_WRITES = FALSE – when set to TRUE, all writing to disk during a file transfer is disabled and no data is written to disk. Received files are the correct size when viewed from the Windows Explorer because the file size is set by updating the directory structure.
    3. MTP_USE_UNBUFFERED_WRITES=TRUE – when set to TRUE, this setting causes MassTransit to use unbuffered writes to disk when receiving files using TCP/IP. In certain cases, there is a significant performance increase to be had by using unbuffered disk writes.
    4. MTP_FORCE_NETWORK_CRC_CHECKING_ON_MTP = FALSE – when set to TRUE, CRC (cyclic redundancy check) checking is performed on all network traffic for the MassTransit Protocol. CRC errors can occur even on reliable links due to unexpected defects in network routers, switches, drivers, or MassTransit itself. This is extremely rare in a properly functioning environment and so this setting should only be used for diagnosing corruption problems. CRC errors that are detected will result in an error in the MassTransit log and a termination of the connection. Enabling this will mark all data being sent from this MassTransit server with a CRC for checking by the remote server. The setting needs to be enabled on both sides of a connection for full bi-directional CRC checking.

      Note: Note that turning on CRC checking on the MTP may impact performance on fast links.

  3. When you have configured the desired settings, save and close the MassTransitEngine.cfg configuration file.
  4. In order to apply the changes immediately, you need to restart the MassTransit service:
    1. Open the Services console from Start → Administrative Tools → Services.
    2. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Stop button from the Services tool bar, or select the Stop option from the context menu of the service.
    3. Highlight the MassTransit Transporter service and click on the Restart button from the Services tool bar, or select the Restart option from the context menu of the service;
    4. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Start button from the Services tool bar, or select the Start option from the context menu of the service.
TCP/IP Tuning Settings

Besides the MassTransit protocol tuning settings, there are additional settings for tuning the TCP/IP communication. To tune TCP/IP, follow these steps:

  1. Open the MassTransitEngine.cfg configuration file in an application suitable for plain text edit. The file is located in the installation directory of MassTransit which by default is located in:
  1. Locate the TCP/IP tuning settings area and configure the desired settings:

    Note: Uncomment the settings you configure if they are commented out in order to activate them. You can do that by deleting the '%%' at the beginning of the line.

    1. TCP_MSS_SIZE = 1460 – the TCP MSS size is the amount of data that can fit into an individual IP packet in bytes. This is typically 1460 bytes, which is the size of the Ethernet frame minus 40 byte for IP and TCP headers. This value is used by MassTransit to size various buffers to prevent mis-alignment of IP frames.
    2. TCP_SEND_MSS_FACTOR = 11 – amount of data to be issued per send request to the TCP stack, represented as the number of TCP_MSS_SIZE units. Increasing this value higher than the TCP stack's internal send buffers can result in performance degradation.
    3. TCP_SEND_CIRCULAR_BUFFER_SIZE = 262144 – size of circular send buffer used by networking threads when writing to the network in bytes. Must be a value bigger than MTP_XFER_BLOCK_SIZE_FACTOR * TCP_MSS_SIZE for MassTransit Protocol.
    4. TCP_RECV_CIRCULAR_BUFFER_SIZE = 262144 – size of circular send buffer used by networking threads when writing to the network in bytes. Must be a value bigger than MTP_XFER_BLOCK_SIZE_FACTOR * TCP_MSS_SIZE for MassTransit Protocol.
    5. TCP_SOCKET_BUFFER_SIZE = 256960 – size of the socket buffers used for TCP window sizing in bytes. This is the value passed to setsockopt() function with SO_SNDBUF and SO_RCVBUF. The value depends on the general size of the pipe (of the connection channel) and the connection latency.

      Note: This setting has no impact on Windows 2008 Server or later because it performs TCP window auto-tuning. It should only be used for Windows Server 2003 / 2003R2.

    To properly enable this on Windows 2003/2003R2, you must enable RFC1323 window scaling by adding the following registry keys to:
        \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

    Note: To open the Registry Editor: click Start, click Run, type regedit, and then click OK.

    DWORD named Tcp1323Opts with a value of 1

    DWORD named GlobalMaxTcpWindowSize with a value of 16777216

    The value should be set to multiple of MSS less than 64K multiplied by a scale factor that is a power of two.
    The chart below shows suitable values at different bandwidths and latency. The ideal buffer size is calculated by the formula:
        [buffersize] = [round trip time (ping time)] * throughput
        e.g. 65536 / 1460 = 44 * 1460 = 64240 * 2^0 = 64240

    BUFFER SIZE

    LATENCY

     

     

     

     

    <5ms RTT

    40ms RTT

    80ms RTT

    200ms RTT

    64240 * 2^0 = 64240 [~64K]

    100Mbps

    10Mbps

    2Mbps

    2Mbps

    64240 * 2^1 = 128480 [~128K]

     

     

    10Mbps

     

    64240 * 2^2 = 256960 [~256K]

     

    45Mbps

     

    10Mbps

    64240 * 2^3 = 513920 [~512K]

    1000Mbps

    100Mbps

    45Mbps

     

    64240 * 2^4 = 1027840 [~1024K]

     

     

    100Mbps

    45Mbps

    64240 * 2^5 = 2055680 [~2048K]

     

     

     

    100Mbps

If TCP_SOCKET_BUFER_SIZE is 0, then no modifications are made. This value is forced as the setting for Windows 2008 Server and later.

  1. When you have configured the desired settings, save and close the MassTransitEngine.cfg configuration file.
  2. In order to apply the changes immediately, you need to restart the MassTransit service:
    1. Open the Services console from Start → Administrative Tools → Services.
    2. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Stop button from the Services tool bar, or select the Stop option from the context menu of the service.
    3. Highlight the MassTransit Transporter service and click on the Restart button from the Services tool bar, or select the Restart option from the context menu of the service;
    4. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Start button from the Services tool bar, or select the Start option from the context menu of the service.
UDP Tuning Settings

In addition to the MassTransit protocol tuning settings, there are additional settings for tuning the UDP communication. To tune UDP, follow these steps:

  1. Open the MassTransitEngine.cfg configuration file in an application suitable for plain text edit. The file is located in the installation directory of MassTransit which by default is located in:
  1. Locate the UDP tuning settings area and configure the desired settings:

    Note: Uncomment the settings you configure if they are commented out in order to activate them. You can do that by deleting the '%%' at the beginning of the line.

    1. UDP_MSS_SIZE = 1052 – the MSS is the maximum UDP packet size in bytes, including all UDT, UDP and IP headers of the packet. Default on Windows it is 1052, because of limitations on how the Windows network driver handles larger UDP packets. To increase this value to 1500, the following registry setting needs to be modified on Windows:
                  HKLM\System\CurrentControlSet\Services\Afd\Parameters\FastSendDatagramThreshold (DWORD) -> 1500

       Info: For more information on modifying the registry, please see http://support.microsoft.com/kb/235257.

  2. When you have configured the desired settings, save and close the MassTransitEngine.cfg configuration file.
  3. In order to apply the changes immediately, you need to restart the MassTransit service:
    1. Open the Services console from Start → Administrative Tools → Services.
    2. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Stop button from the Services tool bar, or select the Stop option from the context menu of the service.
    3. Highlight the MassTransit Transporter service and click on the Restart button from the Services tool bar, or select the Restart option from the context menu of the service;
    4. Highlight the MassTransit (for MassTransit SFTP, the service name is MassTransit SFTP) service and click on the Start button from the Services tool bar, or select the Start option from the context menu of the service.