cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

Handle Large Number of Concurrent Downloads

Open iRajatDas opened this issue 1 year ago • 6 comments

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:

  • OS: macOS
  • API Endpoint: http://[redacted]:9000/api/json
  • Server Configuration: DigitalOcean droplet with 25GB SSD storage and 1 GB RAM running Ubuntu 22.02
  • Using PM2 Manager for running the API
  • Node 18

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.

iRajatDas avatar Jul 23 '24 04:07 iRajatDas

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

wukko avatar Jul 23 '24 12:07 wukko

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

iRajatDas avatar Jul 23 '24 13:07 iRajatDas

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

ihatespawn avatar Jul 23 '24 16:07 ihatespawn

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

wukko avatar Jul 23 '24 16:07 wukko

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

iRajatDas avatar Jul 23 '24 16:07 iRajatDas

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

didn't look at the edits, sorry

ihatespawn avatar Jul 23 '24 17:07 ihatespawn