请问如何允许 aria2 多线程下载?

2020-02-19 17:04:18 +08:00
 s82kd92l
我架了个自用的 nginx 用于中转一些文件,然后用 aria2 拉到本地。使用 aria2 时指定多线程-s5 -j5 无法生效,但是对很多别人的网站,这个是可以生效的,请问应该怎么配置 nginx 以便多线程呢?

我的环境是:
CentOS Linux release 7.7.1908 on openvz
nginx version: nginx/1.16.1
9890 次点击
所在节点    NGINX
8 条回复
Nasei
2020-02-19 17:41:37 +08:00
我瞎猜一下,如果服务端不支持按范围下载之类的特性的话,就没法用多线程
lxk11153
2020-02-19 17:42:35 +08:00
1. https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-j
> --max-concurrent-downloads limits the number of items which are downloaded concurrently. --split and --min-split-size affect the number of connections inside each item.
2. 还要这个感觉可以研究下
> -x, --max-connection-per-server=<NUM>
lxk11153
2020-02-19 17:44:30 +08:00
#2 append 关于 1: 点链接还有更形象的例子说明
nyanyh
2020-02-19 18:43:29 +08:00
nginx 是不是设置了 limit_conn one 1;?
nyanyh
2020-02-19 18:44:10 +08:00
s82kd92l
2020-02-19 18:51:35 +08:00
@lxk11153 加-x 果然有用,多谢!

@nyanyh 搞定了,我没设置连接限制,谢啦!
lxk11153
2020-02-19 19:26:47 +08:00
@s82kd92l #6 仔细理解那几个配置了没?
1. 同时下载任务数,比如同时下载 a,b,c 三个文件(批量下载)
-j, --max-concurrent-downloads=<N>
> Set the maximum number of parallel downloads for every queue item. Default: 5

2. 两个影响每个文件分多少线程下载的参数
-k, --min-split-size=<SIZE>
文件分片大小 Default: 20M
-s, --split=<N>
> Download a file using N connections. Default: 5

3. -x, --max-connection-per-server=<NUM>
> The maximum number of connections to one server for each download. Default: 1
orzfly
2020-02-19 21:00:54 +08:00
祖传参数: -s16 -x16 -k1M

打熟了根本停不下来,哪怕都写进 rc 了也情不自禁会加上……

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/645881

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX