question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sequential requests when downloading file

See original GitHub issue

I’m using the File.download method and was wondering if its performance could be improved.

Currently it makes two requests sequentially:

  1. /storage/…/key?alt=media to download the file
  2. /storage/…/key to download file metadata

Would it be possible to make those requests in parallel? The second request adds another 20 - 250ms to the download.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mattzeunertcommented, Mar 25, 2021

Thanks @stephenplusplus for implementing this, and thanks @danvk for pointing out the second request isn’t necessary!

Just deployed this earlier and reads are now 50% faster.

Screenshot 2021-03-25 at 09 09 01

Also seems like some metadata requests were really slow, and now the max duration is down significantly.

Screenshot 2021-03-25 at 09 08 50

1reaction
mattzeunertcommented, Mar 26, 2021

@danvk It’s a Grafana dashboard running on Hosted Metrics. I think Grafana also has their own Cloud offering too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Download Multiple Files Concurrently in Python
You can use requests for downloading files hosted over http protocol. Run the following command to install requests python library.
Read more >
Downloading multiple files with requests in Python
I have 3 download links in a list. Only the last file in the list is downloaded completely. The others have a file...
Read more >
Sequential downloading is bad - VuzeWiki
Sequential downloading is bad. Since people who have no understanding how bittorrent works often request that files or even pieces should be downloaded...
Read more >
Use Python to Download Multiple Files (or URLs) in Parallel
The easiest way to download files is using a simple Python loop to iterate through a list of URLs to download. This serial...
Read more >
Download Multiple Files (or ULRs) in Parallel with Python
Learn how to use Python to download multiple files (or URLs) in parallel. Downloading file in parallel is very easy with Python.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found