|
Posted by Colin McKinnon on 10/08/05 17:01
David Cartwright wrote:
> "www.douglassdavis.com" <doug@douglassdavis.com> wrote in message
> news:1128730678.638432.58380@g44g2000cwa.googlegroups.com...
>> By that I just mean, run on many computers... Usually the only
>> communication between threads is through the database anyway right (not
>> through shared objects)? I'm thinking you could run it on multiple
>> computers, using the same filesystem, and there shouldn't be
>> problems...
>
Yup, it scales really easily.
>
> There are three ways to go:
>
> 1. Don't use session-based stuff - if you want to preserve state in your
> Web site, pass variables around in GET requests.
> 2. Store the session-based stuff in a centralised database/filestore that
> every server shares.
Actually, there are some options for storing shared information without
centralization. Cluster file systems are one way to go. Another which works
well for very large systems is to use sessionid addressing of the session
management systems (e.g. with N database servers, take the last few digits
of the sessionId - say 2345 - then the session information is stored on
server (2345 % N)). Since PHP allows you to write your own session handler
you can easily build your own solutions incorporating fault tolerance and
the storage substrate of your choice.
> 3. Use a load balancer that is clever enough to load-share but send the
> same visitor back to the same server each time.
>
Doesn't work very well in practice. In addition to the loss of server
problem its not as easy as you might think to identify a client (ip address
can change mid session).
C.
Navigation:
[Reply to this message]
|