The relationship between Java buffer size and download speed

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.