We've two apache/php web servers load balanced with squid page caching proxy. The squid caching isn't participating in image submission pages. There exists a form where customers can submit images.
It is a two step process. They first upload the pictures. The 2nd step they are able to enter particulars concerning the images and pictures are then moved to correct folders after they submit the look particulars.
Issue is when there's high traffic the 2nd step may be offered from the different server then your one using the submitted images. Therefore the next step may not discover the submitted images and upload does not complete.
We've 1000's of image files on these servers therefore the syncing together is slow. Can there be anyway that people can pressure a particular page to continually to become offered from the specific server? Essentially to bypass the burden balancing feature.
You will find a couple of methods to this.
- Change to nginx like a reverse proxy and you will stick clients towards the host
- Result in the upload directory a NFS share installed on both hosts
- Upload the file right into a mysql table (probarbly best to utilize a hash table) so both servers can can get on.
Personally I'd opt for option 1 while you get round robin load balancing, but each connection is stuck towards the host it was attached to.
Option 2 has the advantage of still equally balancing demands, but however the NFS share is really a single reason for failure.
Option 3 may cause issues if there's insufficient ram around the DB server if you are using a hash table.