Long Data Transfer Mechanism
The HTTP Provider Service implements a specific mechanism that facilitates internal communication between the dispatcher and server parts of the service when large response messages have to be transferred. This is the Long Data Transfer (LDT) mechanism. Its main purpose is to handle the transfer of large HTTP messages from the server processes to the Java dispatcher, in a way that guarantees a reasonable consumption of dispatcher’s memory resources and adequate response times. In other words, if a large response is generated by a servlet, for example, the whole amount of data is not transferred to the dispatcher at once. The Long Data Transfer mechanism transfers a smaller portion of it to the dispatcher, and then the system waits until the client reads it. After that, the next portions of the response are transferred by the LDT mechanism to the dispatcher following the same algorithm. If the client stops reading the response, then the server stops sending the remaining portions of data to the dispatcher.
The LDT mechanism has a slightly different implementation in each of the following cases:
· When the LDT mechanism is used to transfer static HTTP resources (images, HTML files, and so on)
· When the LDT mechanism is used to transfer dynamic responses generated by a servlet or JSP.
The static LDT mechanism is used to transfer static HTTP responses (that is, response messages that return static HTML pages, images, and other files) when the size of the requested file exceeds the value of the MinFileLengthForLongDataTransfer property of HTTP Provider Service. If the LDT is activated, it sends the response from the server process to the Java dispatcher as several portions. In order to send the next portion of the response data, the HTTP Provider Service on the server process must receive a callback from the Java dispatcher (the callback is sent when the client finished reading the first portion of the response).
You can control when the LDT mechanism is activated by adjusting the value of the MinFileLengthForLongDataTransfer property. If your system has extra memory resources, you can increase the value of the property, thus achieving better performance at the cost of more memory consumed.
The LDT mechanism for servlet/JSP responses is activated when the length of the response message exceeds the limit set by the ServletsLongDataTransferLimit property of the HTTP Provider Service. The LDT communication is performed as follows:
...
1. The servlet/JSP generates the response and sends to the dispatcher the amount of data specified by the ServletsLongDataTransferLimit property. It then stops and waits for a callback from the dispatcher to confirm this data is successfully sent to the client before sending further response data.
2. The dispatcher sends the data received from the server in portions. The size of the portions is determined by the ServletsLongDataTransferCallbackSize property.
3. After the client has read the above response portion, the dispatcher send a callback to the server to indicate that the client is active and to reset the timeout counter for the connection. If the callback is not sent within the timeout specified by the ServletsLongDataTransferTimeout property, an IOException is thrown that interrupts further generation of the response.
4. After the dispatcher has sent to the client the whole amount of data specified by the ServletsLongDataTransferLimit property, it sends another callback to the server to prompt it to send the next portion of the response.
Based on the description of the mechanism above, two main recommendations can be derived based on the speed of the network the communication is carried over:
· For fast network connections, you can improve overall response times by increasing the value of the ServletsLongDataTransferLimit property at the cost of your system’s additional memory resources.
· For slow network connections, you can decrease the value of the ServletsLongDataTransferCallbackSize property to avoid communication errors due to timeout. In this case, we do not recommend you change the default value of the ServletsLongDataTransferLimit property.
Use the Visual Administrator tool to configure the properties concerning LDT mechanism. Proceed as follows:
...
1. Go to the Properties tab of the HTTP Provider Service on the dispatcher.
2. Enter a new value for the ServletsLongDataTransferCallbackSize property if the default one is not appropriate for your scenario.
3. Go to the Properties tab of the HTTP Provider Service running on the server.
4. Assign values to the MinFileLengthForLongDataTransfer property to configure the static LDT mechanism, and the ServletsLongDataTransferLimit and ServletsLongDataTransferTimeout properties to configure the LDT for dynamic responses.

When calculating the appropriate value of the ServletsLongDataTransferTimeout property, you need to take the client connection speed into account. If it is slow, you need to consider setting a longer timeout period in addition to setting a small callback size with the ServletsLongDataTransferCallbackSize property. The size of the dispatcher’s buffer can also influence the timeout, as a larger amount of buffered data needs more time to be sent to the client.