1, for the buffer space settings, according to the specific situation, if there are a large number of long information (such as file transfer), the buffer definition of larger, may be better use of network resources, if more is a short message (such as chat messages), using a small buffer may be better, so the speed of the refresh will be faster. The default buffer size for the general system is 8*1024. Do not change this setting unless you have a clear picture of what you are dealing with.
2
Apache Commons ftpclient LAN upload file speed should be very fast, but in the actual development found to upload a file snail speed, all because the call the following API:
Ftpclient.storefile (FileName, InputStream)
The reason is that because the default buffer size is 1024, which is 1K, of course, it is slow to re-modify the following default settings before invoking the upload API, such as changing the buffer to 10M,API:
Ftpclient.setbuffersize (1024 * 1024 * 10)
3.
Apache Commons ftpclient LAN upload file speed should be very fast default download speed of 254kb/s,
Ftpclient.setbuffersize (1024 * 1024)
Speeds up to around 5m/s
The relationship between Java buffer size and download speed