|
Posted by Gordon Burditt on 11/03/06 23:16
>I have a php/mysql website where people can upload their own graphics for
>the buttons and background of pages on the website.
>
>This used to run on one server, but I have now been asked to set it up on
>multiple servers.
Why? The reason matters. If it's a matter of more horsepower with lots
of little machines rather than one huge one, that's one thing. If it's
redundancy for extreme reliability, that's another.
>The problem is that when someone uploads a file, how do I distribute it to
>all of the servers? Should I use php to send it to all of the servers once
>it has been uploaded, or is there a better way of synchronizing the files
>between all of the servers?
NFS shared filesystem? Or you divide the files between the systems?
>Also, I am not sure how autologin (based on cookies) and sessions will
>work when distributing across multiple servers, as my understanding is
>that these are on a per domain basis? (i.e. if someone goes to
>node1.site.com and hits autologin, but next time gets node3, the cookie
>wont be picked up?)
If you're using a round-robin DNS scheme or something fancier with
routers and switches for load-balancing, the browser won't know the
difference between node1.site.com and node3.site.com, because it
thinks they're all node.site.com, and you won't have an issue with
domains. Otherwise, use domain cookies rather than individual host
cookies for the session cookie.
It is possible to use a session save handler to put session data
in a MySQL (or other) database rather than a bunch of little files.
If you share this database between webservers, one login can work
across several machines. Also, putting the session data in a
database makes it much easier to expire old data.
Navigation:
[Reply to this message]
|