Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The download task speed gradually becomes 0. #183

Closed
MrGlp opened this issue Aug 14, 2023 · 9 comments
Closed

The download task speed gradually becomes 0. #183

MrGlp opened this issue Aug 14, 2023 · 9 comments

Comments

@MrGlp
Copy link
Contributor

MrGlp commented Aug 14, 2023

发现了个情况,直接使用 Create 方法创建了10个BT任务,每个资源大小 2G->10G 不等

最开始任务添加 Listener 里面的任务还是有下载速度的,打印不为 0
speedInMB := float64(event.Task.Progress.Speed) / 1048576

随后过段时间一个个任务都会逐步变为 0,进度停止【有的任务下载百分之 15 开始没速度,还有 百分之 8,还有的百分之30,60的时候丢失进度】,但是如果重启任务又可以继续获得速度

很多大的资源经常会出现这个问题,不知道是否有思路提供排查


Found a situation, directly using the Create method to create 10 BT tasks, each resource size ranging from 2G->10G

At the very beginning, the task added to the Listener still has a download speed, and the print is not 0
speedInMB := float64(event.Task.Progress.Speed) / 1048576

After a period of time, each task will gradually become 0, and the progress will stop [some tasks download 15% and start to lose speed, there are still 8%, and others lose progress at 30% and 60%], But if you restart the task, you can continue to gain speed

Many large resources often have this problem. I don’t know if there is an idea to provide troubleshooting

@monkeyWie
Copy link
Member

monkeyWie commented Aug 15, 2023

版本号多少啊


What is the version number

@MrGlp
Copy link
Contributor Author

MrGlp commented Aug 15, 2023

主要针对 magnet 测试

  1. 不太确定是 1.3.6 还是 1.3.9 了
  2. 但是不太确定为什么会有那种问题,随着任务数从 1-10,每个任务刚进去都有下载速度,随后都慢慢变为 0,然后 10 个任务都变为0
  3. download.DownloaderStoreConfig 得 MaxRunning 已经设置 2000 了

但是如果单个任务下载成功率还是可以
但是不太确定有没有和任务数目有必要联系

目前排查方向

  1. 我使用了公网 ip
  2. 目前服务器我没有开额外得端口到外网,p2p 默认端口 6881-6999 都关闭了,但是我不确定你那边有没有修改 bt 默认端口
    感觉会不会有这个原因导致 p2p 对等连接的时候,没有办法给其他 peer 提供下载速度,导致我这个 peer 只下载,没法上传,于是下载速度都逐渐终止,但是如果这样的话,那么该项目大部分使用者都应该有这个问题,就是速度变为 0
    但是其他使用者得任务数较少?感受不大?
  3. upd 流量被运营商拦截了,所以我这辈链接任务数上去就都速度归 0
    不知道你那边还有什么思路,主要我是想去解决多任务得情况

Mainly for magnet testing

  1. Not sure if it is 1.3.6 or 1.3.9
  2. But I am not sure why there is such a problem. As the number of tasks changes from 1-10, each task has a download speed when it first enters, and then it slowly becomes 0, and then all 10 tasks become 0
  3. The MaxRunning of download.DownloaderStoreConfig has been set to 2000

But if the download success rate of a single task is still ok
But I'm not sure if there is a necessary connection with the number of tasks

Current investigation direction

  1. I use the public network ip
  2. At present, I have not opened an additional port to the external network on the server. The p2p default port 6881-6999 is closed, but I am not sure if you have modified the BT default port
    I feel that there is no way to provide download speed to other peers during p2p peer-to-peer connection. As a result, my peer can only download and cannot upload, so the download speed is gradually terminated, but if this is the case, then the project Most users should have this problem, that is, the speed becomes 0
    But other users have fewer tasks? Not feeling well?
  3. The upd traffic was intercepted by the operator, so the number of link tasks in my generation returned to 0
    I don't know what other ideas you have, mainly I want to solve the multi-tasking situation

@monkeyWie
Copy link
Member

monkeyWie commented Aug 15, 2023

1.37版本刚好修复了一个bt下载速度计算的问题,可能和你这个有关:
#163


The 1.37 version just fixed a problem of BT download speed calculation, which may be related to you:
#163

@MrGlp
Copy link
Contributor Author

MrGlp commented Aug 15, 2023

大概不是那个问题,我这已经更新到最新的版本几天还是会经常出现速度丢失多任务的话任务全部挂起的情况

不过我大概已经找到了优化思路,我想想办法解决,这些 udp 端口范围是你这边限制的么
image


Probably not that problem, I have updated to the latest version for a few days, and the speed loss often occurs when multitasking, all tasks hang

But I probably have found an optimization idea, I think of a solution, are these udp port ranges restricted by your side?
image

@monkeyWie
Copy link
Member

monkeyWie commented Aug 15, 2023

udp端口范围应该是没有限制的,底层用的是这个库:https://github.com/anacrolix/torrent
我看了下官方有说怎么去自定义udp端口,你可以研究下,相关issue: anacrolix/torrent#378

@MrGlp
Copy link
Contributor Author

MrGlp commented Aug 16, 2023

还和上面的问题不一样了

这次我仔细看了看进出站的流量,明明是一个热度极高的种子,速度打满峰值下载,下载到 90% 左右,突然之间速度开始降低,gopeed listen 打印的速度从极高逐渐跌落 0

文件大小不变了,确实是停止下载

同时,监控到的很多对等连接的进出站流量突然变成 0,十多个链接,前一秒极高后一秒全变成 0b,很难排查,最初我怀疑是没有出站的端口导致无法被对等端下载资源,然后被限制了速度,但是限制我已经把端口全面打开,没想通
image


It is also different from the above problem

This time I took a closer look at the inbound and outbound traffic. It was obviously a very hot seed, and the download speed was at its peak. When the download reached about 90%, the speed suddenly started to decrease. 0

The file size has not changed, and the download is indeed stopped

At the same time, the inbound and outbound traffic of many monitored peer-to-peer connections suddenly became 0, and more than ten links all changed to 0b in the first second and the next second. It was difficult to troubleshoot. At first, I suspected that there were no outbound ports. The resource cannot be downloaded by the peer, and then the speed is limited, but I have fully opened the port for the limit, I can't figure it out
image

@MrGlp
Copy link
Contributor Author

MrGlp commented Aug 16, 2023

补充,上面的资源我第二次下载一路高速冲刺到 100%


Supplement, I downloaded the above resources for the second time and sprinted all the way to 100%

@MrGlp
Copy link
Contributor Author

MrGlp commented Aug 18, 2023

先关闭了,和 torrent 库默认对多任务得支持有所关系,我得想想办法咋改


Close it first, it has something to do with the torrent library’s default support for multitasking, I have to find a way to change

@MrGlp MrGlp closed this as completed Aug 18, 2023
@monkeyWie
Copy link
Member

monkeyWie commented Aug 18, 2023

嗯嗯,加油少年!


Mmmm, come on boy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants