I currently run a popular classifieds website which runs on 2 servers. There are currently 2 servers, one webserver and one database server. They are running Linux and the website is coded in place and MySQL.
I am in the process of upgrading the servers as the site is outgrowing the existing server setup. I have bought another server to act as another webserver which is conneced to the existing 2 servers in a private network. So I would have 2 we servers and one database server.
The website has a large number of images continously uploaded and removed from the website by the users. The original idea was to have the 2 web servers sync files including images. But I think due to the large number of images to sync, there maybe issues with the images not being synced straight away.
I am just trying to find out the best and most robust solution to this, as I am sure it's a common issue a lot of growing websites must face.
The ideas I had so far are:
1) sync both webservers. Could be slow and times when images are not yet available on both servers. 2) mount images directory so that both webservers upload to same directory. Would this slow uploading of images? 3) change upload photo php script to upload to Amazon s3 bucket and serve images using anmazon cloud front. Although I think this maybe expensive due to the large number of images the website serves each month.
Any ideas or links to further reading would be great.