[nylug-talk] Sharing state between frontend web servers

Hans Zaunere lists at zaunere.com
Mon Jul 2 19:54:59 EDT 2007



Michael Bacarella wrote on Monday, July 02, 2007 2:56 PM:
> I have web server A.
> 
> We want handle increased load and add fault tolerance by
> adding web server B.
> 
> The challenge is of course synchronizing sessions and
> uploaded content between web server A and B.  I've
> usually set up an NFS server F and have both A and B
> map the exported filesystem from F.
> 
> While this solves some scalability issues, it does move the
> point of failure to F; but this is solved by setting up a
> periodic rsync from F to duplicate server G.

I would not recommend NFS for this.  With any type of traffic, you'll run
into lock problems.

> I wonder if anyone uses other approaches with success?

Use a database or memcachd as previously recommended.

Remember that in most architectures, session/state data isn't considered
critical to persist.  While HA is important to keep the site online, unlike
real DB transactions, if data is lost the user should only need to re-login.

MySQL with proper configuration and storage engine use can be good for these
purposes.  MySQL Cluster can also be effective for session data if traffic
warrants it.

---
Hans Zaunere / President / New York PHP
    www.nyphp.org  /  www.nyphp.com




More information about the nylug-talk mailing list