i've 2 servers.
- Server A : contains
- mysql
- apache
- nginx
- Server B : contains
- apache
- memcached
- rsync cron ( each 3 mins ) that pulls the /var/www/ content and update its own
I'm using:
- nginx of Server A to load balance the http requests. (And it work just fine).
- memcached from server B to maintain php sessions
Nginx currently load balances asking Server B to handle 75% of the requests.
In order to sync the application code ( which is written in php ) i use rsync ( as explained above ).
The problem of rsync is that I can't handle 2 way sync so I was starting looking at Unison.
At this point I've 2 questions:
- Would it be a good idea to ask nginx to route all the "send file" requests to Server A so that Server B only needs to pull?
- Should I use Unison or some other software for this kind of sync? Can I get a realtime sync?
- Should I use some network file system that shares the content of /var/www/ from Server A to Server B? If yes. What do you suggest?