Multi-user mass image uploads with PHP


Question: 

I'll soon be building a competition microsite which is based entirely around image uploads: in order to enter, users will need to upload an image.

I've previously built a similar website on top of a PHP MVC framework, which worked awesomely up until a couple of hours before the competition was due to close, where a rush of last minute entries caused the server to crash, rendering the website inaccessible. The files being uploaded were pretty large in some instances (images scanned by the average user, many of whom did not know about optimizing file sizes).

I'd obviously like to avoid this issue the best I can with this new project, and would appreciate tips on how to build a robust site that won't crash when the last minute rush of entries comes through.




1 Answer: 

That's hard to answer. You'll just have to figure out where exactly the bottleneck is in your app and improve that particular part. Is it the webserver itself which is flooded with too many simultaneous, long running connections? Then tune the server to accept fewer connections at once and account for it in your front-end somehow, use a different kind of server, use a beefier server or use multiple load-balanced servers. Or is it whatever post-processing you're doing? Then optimize that to not process hundreds of images at the same time, but use a queue-worker system or farm out the processing work to other servers. Or is it the amount of images being downloaded? Then you may want to look at a CDN.

Again, analyze what the problem is and look for a specific solution to it.

 

More Articles


How do I access my website (IIS) from the internet?

I have installed IIS. I have browsed to my website on IIS using the 'Browse *:80 (http)' link in IIS. This navigates to http://localhost. That link is only going to work on my own machine.I don't care about my IP address changing (I'm going to show my website for a few hours max every now and the

Revert from Python 2.7 to Python 2.6 in Mac OSX 10.6.8 doesn't work even though I've uninstalled Python 2.7

I have mac OSX 10.6.8. My system came with Python 2.6I recently installed Python 2.7 but experienced many problems with it so decided to revert back to Python 2.6 by executing $ sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7I also removed Python 2.7 from my Applications folder. Still

scala - Should I use collectionAsScalaIterable({java collection}) or Seq({java collection}).flatten?

We're starting to use Scala Test to test our Java application, and I want to test the contents of a Java Collection. We came up with 2 possibilities:JavaConversions.collectionAsScalaIterable(getJavaCollection()) must contain(allOf(item1, item2).inOrder)orSeq(getJavaCollection()).flatten mustEqual Se


authentication - Sitecore - Prevent access to a page, but still show it in the navigation

In Sitecore I have denied access to a particular page for the anonymous user. This works correctly, but it also means that the page does not appear in the navigation menus and sitemap (both XSLT).What I would like is for the user to be able to see the link, but be redirected to a Register/Login page

Apply function to one element of a list in Python

I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python.For example, for the following input:inp = ("hello", "my", "friend")I would like to be able to get the following output:out = ("hello", "MY", "friend")I came up with t

pycharm - pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled

I can't figure out how to fix this PyCharm warning. I started getting it after I migrated my account to a new Mac. (I also just updated PyCharm.) Another symptom is the PyCharm editor is complaining about references to methods on commands like "logging.info()". Even though when I run my app, it s


How can I use a Java List with Scala's foreach?

This question already has an answer here: Iterating over Java collections in Scala 9 answers

mapreduce - Hadoop difficultie with composite key

I'm using Hadoop to analyze GSOD data (ftp://ftp.ncdc.noaa.gov/pub/data/gsod/).I chose 5 years to executed my experiments (2005 - 2009).I've configured a little cluster and executed a simple MapReduce program that gets the maximum temperature registered for a year.Now I have to create a new MR progr

php - Magento Ajax Shipping Calculation?

See http://www.gymandfitness.com.au, goto a general product and on the top left of the product info section theres a field where you enter your local POSTCODE and and it instantly gets the shipping cost without refreshing the page.Is there a good Magento Module that will do that?Or How would I go ab

dplyr - aggregate from weekly to monthly data frame for a grouped data in R

My df had different states associated with their cities of weekly data with value_1 and value_2 structure(list(city_id = c("FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS030", "FS