imputnet / cobalt

best way to save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
15.28k stars 1.25k forks source link

Handle Large Number of Concurrent Downloads #649

Open iRajatDas opened 2 months ago

iRajatDas commented 2 months ago

I encountered an issue with the download links generated by the API. When I create 7 download links and attempt to access the 7th link, it keeps loading in the browser tab until the previous 6 downloads complete.

image

Steps to Reproduce:

  1. Create 7 download links using the following command:

Yes, the below curl will work until sometime for testing

curl 'http://<redacted>:9000/api/json' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
  --data-raw '{"url":"https://www.youtube.com/watch?v=LXb3EKWsInQ","vQuality":"4320","filenamePattern":"basic"}'
  1. Click on the 7th download link.

Expected Behavior:

The 7th download link should start downloading the video immediately without waiting for the previous 6 downloads to complete.

Actual Behavior:

The 7th download link keeps loading in the browser tab until one of the previous 6 downloads complete.

Additional Information:

I know the server is not that strong, but I did not find the best documentation for it either.

Please let me know if any additional information is needed.

wukko commented 2 months ago

can you check how your server’s doing when you spam it with stream requests thru htop?

iRajatDas commented 2 months ago

I am not sure what specific details to share, Here's the screenshot after spamming 7 downloads

image

Also some videos was downloaded incomplete and zero bytes too

ihatespawn commented 2 months ago

you showed the server ip that you redacted in your first message 2 times now

wukko commented 2 months ago

i was the one who redacted it, it literally says in the edit

iRajatDas commented 2 months ago

i was the one who redacted it, it literally says in the edit

Please let me how to fix this issue or the server configurations/requirements, thanks

ihatespawn commented 2 months ago

i was the one who redacted it, it literally says in the edit

didn't look at the edits, sorry