I have 3 web servers for my PHP application. In front of web servers, there are load balancers. My application has a upload image form. I need to have any uploaded image via my form, simultaneously be in all 3 web servers. I try to think about various ways but I can't decide which solution would be perfect for production environment. All of my servers are Debian Squeeze by the way.

Could you please suggest new ideas for me or review my ideas below :

  1. PHP script can save images three times: one into local server and 2 other web servers via network share or something else.

  2. PHP can save image into local file system and initiate rsync operation to send the uploaded file to other two servers.

  3. Upload folder can be on only one of web servers. On the other two servers, upload folder can be remote ssh mount (with fuse or something else). (But with this option I should take the risk of single point of failure. It is a bad thing)

  4. Images can be saved another server like DB servers (MySQL, PostgreSQL) but I don't want images to be in DB.

Anything to suggest?

Thanks, Ugur


I'm using:

  • rsync + incrond for nearly real time
  • DRBD + ocfs2 as shared storage

About the option 3': you can build a high available NFS server with DRBD and Pacemaker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.