1

I want to provide in Azure MVC web site a Download link for files that are stored in Blob storage. I do not want the users see my blob storage Url and I want to provide my own dowload link to provide the name of the file by this as well.

I think this can be done with passing(forwarding) the stream. Found many similar questions here in SO, eg here: Download/Stream file from URL - asp.net.

The problem what I see is here: Imagine 1000 users start downloading one file simultaneously. This will totaly kill my server as there is limited number of threads in the pool right?

I should say, that the files I want to forward are about 100MB big so 1 request can take about 10 minutes.

I am right or can I do it with no risks? Would async method in MVC5 help? Thx!

Update: My azure example is here only to give some background. I am actualy interrested in the theoretical problem of the Long Streaming Methods in MVC.

Community
  • 1
  • 1
Lukas K
  • 6,037
  • 4
  • 23
  • 31
  • Can you not use Shared Access Signature and provide time limited access to the files in your blob storage? – Gaurav Mantri Feb 18 '14 at 13:37
  • This is what I have now, but as said, I want to hide the url to blob and I want to use my own Url pattern to provide better file name when the user clicks the link. I know I can achieve this with rewrite rules in IIS, but I would like to avoid this. – Lukas K Feb 18 '14 at 19:09

1 Answers1

0

in your situation Lukas, I'd actually recommend you look at using the local, temporary storage area for the blob and serve it up from there. This will result in a delay in delivering the file the first time, but all subsequent requests will be faster (in my experience) and result in fewer azure storage transaction calls. it also then eliminates the risk of running into throttling on the azure storage account or blob. Your throughput limits would be based on the outbound bandwidth of the vm instance and number of connections it can support. I have a sample for this type of approach at: http://brentdacodemonkey.wordpress.com/2012/08/02/local-file-cache-in-windows-azure/

BrentDaCodeMonkey
  • 5,493
  • 20
  • 18
  • This is interresting idea with the temp local storage. But this actualy does not solve my problem with the simultaneous long requests. I am afraid when too many users use at the same time the Long-Streaming-Download method, it will lock complete server. – Lukas K Feb 18 '14 at 19:20
  • but what is does do is help reduce the risk of any bandwidth contention you might have on the individual blob file (which has a scale target of 500tps and 60 MBytes/sec). – BrentDaCodeMonkey Feb 18 '14 at 21:25
  • In that point you are right, I was not aware of that issue. Thx – Lukas K Feb 19 '14 at 14:03