Today I ran into one of the limitations of shared hosting.
I’ve been struggling for the last few weeks to handle large files in my application. I published to the server earlier this week but with no success. All my tests failed after 10 minutes with a ‘Request timed out’ error. I was testing with an 80mb file but with a slow broadband connection (thanks to Ice). I had increased the timeout and max request length for the upload handler like so in the web.config:
<location path="Upload.mvc/Upload"> <system.web> <httpRuntime maxRequestLength="2097151" executionTimeout="10800" /> </system.web> </location>
I ruled out any setting that I had control over, so the next step was to talk to my hoster, Blacknight, to see if they could help me out. They replied saying that they could not support the uploading of large files stating that:
It ties up too much system resources to upload huge files like that through asp and would cause problems for other users on the shared server.
Of course they’re right and I can’t really complain but it’s bitterly disappointing none the less.
For the foreseeable future, a couple of file uploads a month is all I require so I don’t want to pay for more expensive hosting packages. So back to the drawing board…
I’m already using the Amazons S3 service for the storage of the images and I think I can upload directly from the client to S3. So I just need a high spec PC for a few minutes to process the files after the user has uploaded them. Once processed I will only ever have to deal with smaller versions or tiled sections. This looks like an ideal candidate for the Amazon Elastic Compute Cloud (EC2). Where I can pay by the hour for a high spec machine.
I was hoping to dip my toe into some cloud computing at some point but I didn’t want to be pushed. This is going to be a lot more work than I hoped and will need some effort just to cordinate between the web server, client machine and a cloud computer.
I haven’t decided on the final architecture yet, just thinking out loud, but looks like a lot of fun (and hard work) ahead…