Using NFS for scalable PHP/MySQL web application

Posted by Jeroen Moons on Server Fault See other posts from Server Fault or by Jeroen Moons
Published on 2012-12-16T10:28:28Z Indexed on 2012/12/16 11:08 UTC
Read the original article Hit count: 231

Here's the situation:

I have a PHP/MySQL web application that accepts user uploads (pdf files). From these pdf files' pages a preview image is made on the fly and presented to the web app's users. Some pdfs might be on the large side, most will be under 50 MB but some extreme cases could be as large as a few hundred MB. A little waiting for the preview image for large pdf files is acceptable but no more than a minute let's say. Everything is running on one server for now, but soon the app will hit the server's limit on both storage and processing power.

My idea to solve the problem:

To deal with this situation I had the idea of having one or more pdf processing servers as needed, and one or more file storage servers. These two types of servers are mounted to the server on which the actual app runs using NFS. The app could then use GearMan to delegate pdf processing tasks to these processing servers. The processing server can mount the storage server and read the file stored there, process it and write its output to that server. The servers I'm talking about will be amazon ec2 instances.

The web app returns a link to the resulting pdf preview image on the storage server that was used which can then be used on the front end to show the image to the user.

My question:

I have zero experience with apps that use multiple servers, is this idea viable or is there a better way to do it? Is an NFS setup fast and reliable enough for this situation?

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about nfs