简体   繁体   English

使用 aria2c 下载单个大文件

[英]downloading a single large file with aria2c

I want to download a file that is around 60GB in size.我想下载一个大约 60GB 的文件。

My internet speed is 100mbps but download speed is not utilizing my entire bandwidth.我的互联网速度是 100mbps,但下载速度没有利用我的整个带宽。

If I use aria2c to download this single file, I can utilize increased "connections per server"?如果我使用 aria2c 下载这个单个文件,我可以利用增加的“每台服务器的连接数”吗? It seems aria2c lets me use 16 max connections.似乎 aria2c 允许我使用 16 个最大连接。 Would this option even work for downloading a single file?此选项甚至适用于下载单个文件吗?

The way I'm visualizing how the download goes is like 1 connection tries to download from 1 sector of the file, while the other connection tries to download from a different sector.我想象下载过程的方式就像 1 个连接尝试从文件的 1 个扇区下载,而另一个连接尝试从不同的扇区下载。 And basically, the optimal number of concurrent download is until the host bandwidth limit is reached (mine being 100mbps).基本上,并发下载的最佳数量是直到达到主机带宽限制(我的是 100mbps)。 And when the two connections collide in the sectors they are downloading, then aria2c would immediately see that that specific sector is already downloaded and skips to a different sector.当两个连接在它们正在下载的扇区中发生冲突时,aria2c 会立即看到该特定扇区已被下载并跳到不同的扇区。 Is this how it plays out when using multiple connections for a single file?这是对单个文件使用多个连接时的表现吗?

Is this how it plays out when using multiple connections for a single file?这是对单个文件使用多个连接时的表现吗?

HTTP standard provideRange request header, which allow to say for example: I want part of file, starting at byte X and ending at byte Y. If server do support this gimmick then it respond with 206 Partial Content . HTTP 标准提供Range请求标头,例如允许说:我想要文件的一部分,从 X 字节开始,Y 字节结束。如果服务器确实支持这个噱头,那么它会以206 Partial Content响应。 Thus knowing length (size) of file (see Content-Length ) it is possible to lay parts so they are disjoint and cover whole file.因此,知道文件的长度(大小)(请参阅Content-Length ),就可以铺设部分,使它们不相交并覆盖整个文件。

Beware that not all servers support this gimmick.请注意,并非所有服务器都支持此噱头。 You need to check if server hosting file you want to download do so.您需要检查要下载的服务器托管文件是否这样做。 This can be done using HEAD request, HTTP range requests provides example using curl这可以使用HEAD请求来完成, HTTP 范围请求提供了使用curl示例

curl -I http://i.imgur.com/z4d4kWk.jpg

HTTP/1.1 200 OK
...
Accept-Ranges: bytes
Content-Length: 146515

If you have bytes in Accept-Ranges this mean that server does have support.如果你在Accept-Rangesbytes ,这意味着服务器确实有支持。 If you wish you might any other tool able to send HEAD request and provide to you response headers.如果您愿意,您可以使用任何其他工具发送HEAD请求并提供响应标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM