tgdrive / teldrive

Telegram Drive
MIT License
1.72k stars 251 forks source link

Download speed drop by 1/3 after 1.4.25 #357

Closed vavtnen closed 16 hours ago

vavtnen commented 19 hours ago

Prior to this update I get around ~150MiB but only get ~50MiB now. I've tried to download the same file multiple times. I think it has to do with the removal of bg bots (https://github.com/tgdrive/teldrive/commit/a1440b1d7a06b2f2d8e135b14ffe3bc75ed18b52).

divyam234 commented 16 hours ago

@vavtnen This is unrelated to bg-bots removing it has no affect on download speeds telegram lately has some troubles with servers , generally for increasing download speeds you can enable multi threaded streams by adding

[tg.stream]
multi-threads=8
stream-buffers=16

in config file and using stream endpoint (replace download with stream in download link).

vavtnen commented 13 hours ago

Here is what I have for config.toml [tg.stream] multi-threads = 16
buffers = 30 bots-limit = 48 stream-buffers=32

rclone config is using stream

This is the download speed from the latest version using aria2c -x 16 -s 16 09/19 08:04:56 [NOTICE] Downloading 1 item(s) [#622a6f 1.9GiB/23GiB(8%) CN:16 DL:53MiB ETA:6m57s]

This is the download speed from version 1.4.20 using aria2c -x 16 -s 16 09/19 08:11:56 [NOTICE] Downloading 1 item(s) [#3dd258 2.1GiB/23GiB(8%) CN:16 DL:163MiB ETA:2m16s]

Both versions use the same configs, but download speed is much slower with the latest version.

divyam234 commented 13 hours ago

@vavtnen From 1.4.22 rate limit is added in downloads you can disable it in config , in earlier version you were downloading without rate limit , its recommeded to not disable it to prevent account bans.

rate-burst = 20
rate = 50

Try to set rate as above which will give you decent speed around 100MB/s without disrespecting rate limits

vavtnen commented 1 hour ago

@divyam234 the speed is still around ~50MB/s with your rate limit setting. It went up to ~200+MB/s if I disable the rate limit.

runCmd.Flags().BoolVar(&config.TG.RateLimit, "tg-rate-limit", true, "Enable rate limiting for telegram client") runCmd.Flags().IntVar(&config.TG.RateBurst, "tg-rate-burst", 5, "Limiting burst for telegram client") runCmd.Flags().IntVar(&config.TG.Rate, "tg-rate", 100, "Limiting rate for telegram client")

This block of code has been the same through out all version. Did you just implemented the rate limit feature in 1.4.22?

I will play around with the rate limit setting to see what I am able to push without disrespecting the rate limit.

Thanks.