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

Download Speed Gradually Drops to 0 #698

Open
kaedei opened this issue Sep 13, 2024 · 4 comments
Open

Download Speed Gradually Drops to 0 #698

kaedei opened this issue Sep 13, 2024 · 4 comments

Comments

@kaedei
Copy link
Contributor

kaedei commented Sep 13, 2024

In the latest version, if multiple download tasks (e.g., >5) are added simultaneously, the download speed for all tasks gradually drops to 0 after some time. This often happens after the first task is completed or when the remaining tasks are about 50% done.

I reviewed the recently updated code but haven't pinpointed the exact location or possible cause of the issue.

I tried rolling back the repository to versions from September 11, 2024, September 7, 2024, August 30, 2024, August 19, 2024, and August 10, 2024. I found that the batch download function works normally without the speed dropping to 0 only when I rolled back to the August 10, 2024 version (f9b120f).

I looked through the nearby commits and suspect that 9a6db98 might be causing the issue, but I couldn't identify any problems in the code and am not sure if this judgment is correct.

@alanmcgovern
Copy link
Owner

Interesting!

Out of curiosity, do you have logs from one of these sessions which indicates which messages were being sent when the connection was (eventually) dropped? If not, can you share one or two of the torrents where this is happening? Perhaps there's an edge case which I haven't hit yet which is causing one piece to be undownloadable, or repeatedly fail hash checks.

@alanmcgovern
Copy link
Owner

@kaedei Also, could you try with the pre-release 3.0.3-alpha.unstable.rev0049 version in case that resolves the issue? I think i made a few more changes to upgradeable connections since that suspect commit landed after I identified some issues, so perhaps you're experiencing one of those?

@kaedei
Copy link
Contributor Author

kaedei commented Sep 19, 2024

@kaedei Also, could you try with the pre-release 3.0.3-alpha.unstable.rev0049 version in case that resolves the issue? I think i made a few more changes to upgradeable connections since that suspect commit landed after I identified some issues, so perhaps you're experiencing one of those?

Thank you for the reminder. I created a demo project and tried using the latest version of the nuget package 3.0.3-alpha.unstable.rev0049 to download multiple torrent tasks.
The code is available at: https://github.com/kaedei/monotorrent-303-speed-test

I found that the issue seems to be related to the .NET version I am using. I created two Console App projects with .NET 8 and .NET framework 4.6.2, using the exact same test code and referencing the latest monotorrent. It turns out that the MonoTorrent in the .NET 8 version is very fast and has no issues, while the .NET 4.6.2 App takes a long time to start downloading and is very slow.

Could this difference be the reason for the slow download speed?

@alanmcgovern
Copy link
Owner

Hrm, that's interesting. It'd imply there's a bug or issue in one of the backwards compatibility fallbacks for older .net versions (probably!). I'll give that a shot. I rarely use with .net472 version myself and rely on the testsuite to catch issues.

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