Download large files
See original GitHub issueWhen using async
semantics to get a large file, the whole file must be read into RAM, also blocking a thread. This is especially an issue in a server environment.
One might expect the following to work:
IO::Stream stream;
await m_client.GetObjectAsync(this.m_bucket,
path,
s => stream = s,
cancellationToken);
await data = stream.read() ...
However that fails because the stream “s” must be consumed inside the stream callback. This is because RestSharp closes the request immediately after calling the callback. There is actually a closed issue over there on that:
https://github.com/restsharp/RestSharp/issues/539
While that may be an “edge case” for RestSharp, it is clearly an issue here where we could easily be dealing with large files. The only way to read a file is as in the example:
IO::MemoryStream stream;
await m_client.GetObjectAsync(this.m_bucket,
path,
s => s.CopyTo(stream),
cancellationToken);
data = stream.read() ...
However, that uses much RAM and blocks a thread in the threadpool when being run in a service.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Test File Download | 10GB, 5GB, 1GB, 512MB, 200MB ...
Here to test file download of 10Gb, 5GB, 1GB, 512MB, 200MB, 100MB, 50MB, 20MB, 10MB, 5MB, 1MB, or 100KB. Test downloading speed in...
Read more >Download Test Files
We suggest only testing the large files if you have a connection speed faster than 10 Mbps. Click the file you want to...
Read more >Download & Generate Test Files - Fastest Fish
Download test files of any size. Including 1GB, 2GB, 5GB, 10GB or generate a file of any size. Download over the network or...
Read more >Download Test Files
Download Test Files ; Very Large File 1 GB (1,024 MB) · Port: 80, 81, FTP: ftp ; Large File 0.5 GB (512...
Read more >how to download very large files in chrome
Append disk-cache-dir="F:\destination" to the target field of the Chrome shortcut · Start Chrome · Under Chrome > Settings > Advanced > Downloads ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is this still planned? I thought it was strange when I first saw to access the stream you had to provide a callback, i guess that’s just because of RestSharp?
IMO this makes the client library pretty limiting.
Please consider to reopen this issue, because for the minio main use case it seems to have a high priority to support downloading files async and be able to stream files without loading the whole content into memory. A closed issue does not support improving this in near future.