java ftp 下载 多线程_如何使用多线程通过FTP下载文件?

如果服务器限制每个连接的带宽,例如@fge在注释中表示,则建立多个连接以从FTP服务器下载文件可能是有益的。我们来看看一些例子:假设您有一个8 mbps的Internet连接,这使您的理论最大下载速度为1兆字节/秒。Scenario 1: You're downloading a 100 megabyte file from an FTP server that doesn't impose a ...
摘要由CSDN通过智能技术生成

如果服务器限制每个连接的带宽,例如@fge在注释中表示,则建立多个连接以从FTP服务器下载文件可能是有益的。

我们来看看一些例子:

假设您有一个8 mbps的Internet连接,这使您的理论最大下载速度为1兆字节/秒。

Scenario 1: You're downloading a 100 megabyte file from an FTP server that doesn't impose a download limit.

If you're downloading the file using one connection, you download it

at 1 megabyte/sec, what takes you 100 seconds (1min 40sec).

By using two connections (assuming it is possible over FTP to download different pieces of one file at the same time) you download the file at 0.5 megabytes/sec

for each connection, totaling 1 megabyte/sec, what also takes you 100

seconds (1min 40sec) to download the file.

So we conclude that, in this scenario, multiple connections do not

help.

Scenario 2: You're downloading a 100 megabyte file from an FTP server that imposes a download limit of 0.5 megabytes/sec fo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值