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 limit on chunks #179

Open
adel-bakhshi opened this issue Jan 5, 2025 · 4 comments
Open

Download speed limit on chunks #179

adel-bakhshi opened this issue Jan 5, 2025 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@adel-bakhshi
Copy link

Hello,
First of all, thank you very much for creating this package and making it available to others for free.
Thank you so much to you and everyone involved in the development of Downloader ❤️.

The issue I'm facing is that when I enable ParallelDownload for the chunks to download simultaneously, it seems like the download speed gets divided among the chunks so that all of them have roughly the same speed.

In such a situation, if the file is divided into 8 parts and 7 parts have been fully downloaded, the eighth part downloads at one-eighth of the main speed (or, if there's a speed limit, at one-eighth of the limit).

I'm not sure if I'm mistaken or if the settings I've configured are causing the problem, but this is what I've observed. Could you please guide me on how to solve this issue?

@adel-bakhshi
Copy link
Author

I found this code and as I was saying the speed is divided by the number of chunks.
Wouldn't it be better to divide this value by the number of active chunks? I remember seeing such a property but I don't know where it is.

image

This is also happening in this section with the change in maximum speed.
image

And finally, the maximum speed of reading data from the Stream is set here.
image

If possible, add a property to the DownloadConfiguration class to set the download speed of the chunks. For example, they should be the same or have no limit.

@bezzad bezzad self-assigned this Jan 10, 2025
@bezzad bezzad added the good first issue Good for newcomers label Jan 10, 2025
@bezzad
Copy link
Owner

bezzad commented Jan 10, 2025

Hello,
Thank you for opening this issue and providing detailed feedback! You’re absolutely right the MaximumSpeedPerChunk should indeed be adjusted according to the number of active chunks. This is a valid point, and it makes sense to ensure the speed limit is distributed dynamically based on the current download state.

I’ll work on fixing this behavior in the next version of the Downloader. Your feedback is greatly appreciated, and it helps improve the project for everyone.

If you have any additional suggestions or encounter further issues, feel free to share them. Thanks again for your contribution!

Best regards,

@adel-bakhshi
Copy link
Author

Hello
Thank you very much for your reply.
What I did is a small thing compared to your great work and I am very grateful to you.
I will do everything I can to improve Downloader
Once again, I appreciate you and your efforts 🙏

@bezzad
Copy link
Owner

bezzad commented Jan 13, 2025

Hi @adel-bakhshi
Please test last version 3.3.2.
I fixed this issue. Now, calc the max speed according by active chunks count.
Thank you for feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

2 participants