Delphi Datasnap significantly enhance the efficiency of data transmission method

Method One: Increase TCP read and write cache size
       components DataSnap Server is responsible for TCP / IP communication is TDSTCPServerTransport, it defaults to read and write buffer size TCP / IP is 32KB, set by BufferKBSize property. The test results show that the default buffer size is only suitable for the situation to return very small data sets, in return large data sets, or upload files to the database / download files from the database, etc., can cause serious data transmission inefficiencies, as compared with normal up to ten times the gap, to adjust the buffer size to 512KB or even a little higher will be able to resolve this issue. Each Server Session are doing a little bit more memory consumption, but generally each session other aspects of memory consumption is much larger than 512KB, and therefore the increase in the percentage of memory consumption is not much, Besides, now even ordinary PCs are equipped with more than 8GB memory, so BufferKBSize adjusted to 512KB in all cases there is little problem. If the number of concurrent too many runs out of memory, can be adjusted to consider BufferKBSize even 256KB 128KB. A method is provided as shown below:

 

 

 

 Editing the server only address downlink transmission efficiency, transmission efficiency to improve uplink, TSQLConnecton BufferKBSize the client also needs to do the same modification, as shown below:

 

 

 

Method two: using compressed data transmission mode
      TDSTCPServerTransport built PC1, RSA and ZLibCompression three kinds of filters for selection, set by Filters property. Wherein ZLibCompression for compressing data transmission. Database table inside the data duplication of more compression ZLib compression ratio can usually be up to 4 to 10 times, in which the bandwidth of 20Mbps or less remote connections, can significantly improve the transmission efficiency, while reducing the occupied bandwidth of the line . However, the speed or above 100Mbps LAN, since the data compression rate can not keep up speed of the network, compressed data transmission mode in this case, it will deteriorate the data transmission efficiency, thereby compressing the data transmission is not available for the local area network. DataSnap compressed data transfer with only the server settings, the client does not need to do any setting. A method is provided as shown below:

 

 

 

                
----------------
Disclaimer: This article is CSDN blogger "bluestorm 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/BlueStorm/article/details/81282671

Guess you like

Origin www.cnblogs.com/railgunman/p/11456344.html